xionghaojie %!s(int64=3) %!d(string=hai) anos
pai
achega
d5a0235a2a

+ 14 - 1
src/App.vue

@@ -106,6 +106,8 @@ import editorProduct from '@/components/View/editorProduct'
 import settingProduct from '@/components/setting/settingProduct'
 import editorRecharge from '@/components/View/editorRecharge'
 import settingRecharge from '@/components/setting/settingRecharge'
+import editorCoupon from '@/components/View/editorCoupon'
+import settingCoupon from '@/components/setting/settingCoupon'
 export default {
   components: {
     editorImage,
@@ -122,6 +124,8 @@ export default {
     settingProduct,
     editorRecharge,
     settingRecharge,
+    editorCoupon,
+    settingCoupon,
 
     materialManage
   },
@@ -214,6 +218,15 @@ export default {
             showSubButton:true,
             subButtonName:'激活卡充值'
           }
+        }, {
+          name: '优惠券',
+          key: 'coupon',
+          icon: 'l-youhuiquan.png',
+          com: 'editorCoupon',
+          setCom: 'settingCoupon',
+          value: {
+            couponObj:{}
+          }
         }],
       view: [],
       type: '',
@@ -379,7 +392,7 @@ export default {
     },
     // 提交
     submit() {
-      // console.log(this.view)
+      console.log(this.view)
       this.checkSubmit()
       if (this.pass) {
         let posObj = {

BIN=BIN
src/assets/images/l-youhuiquan.png


+ 169 - 0
src/components/View/editorCoupon.vue

@@ -0,0 +1,169 @@
+<template>
+    <div class="coupon">
+        <div class="li">
+            <div class="lit">
+                <img src="https://zhiqiyun.oss-cn-hangzhou.aliyuncs.com/static/yhq_wei.png" class="lqbg" />
+                <div class="lits dflex">
+                    <div class="left"><span>¥</span><span
+                            class="jine">{{content.value.couponObj.couponAmount?content.value.couponObj.couponAmount:6}}</span>元
+                    </div>
+                    <div class="tong flex">
+                        <div>{{content.value.couponObj.couponType == 1 ? '满减券' : '代金券'}}</div>
+                        <span>{{content.value.couponObj.couponBrief?content.value.couponObj.couponBrief:'优惠券描述'}}</span>
+                    </div>
+                    <div class="lqbtn">立即领取</div>
+                </div>
+            </div>
+            <div class="right">
+                <div>使用日期:{{content.value.couponObj.couponStart?content.value.couponObj.couponStart:'xxxx-xx-xx xx:xx:xx'}}至{{content.value.couponObj.couponEnd?content.value.couponObj.couponEnd:'xxxx-xx-xx xx:xx:xx'}}</div>
+                <div>适用范围:{{content.value.couponObj.couponTitle?content.value.couponObj.couponTitle:'适用范围'}}</div>
+                <!-- <img src="/product/static/product/img/yhq_gq.png" class="guoqi" /> -->
+            </div>
+        </div>
+    </div>
+
+</template>
+
+<script>
+export default {
+    name: 'editorCoupon',
+    props: ['data', 'className'],
+    data() {
+        return {
+            content: this.data,
+        }
+    },
+    watch: {
+        data: {
+            deep: true,
+            handler(val) {
+                this.content = JSON.parse(JSON.stringify(val));
+            },
+        },
+    },
+}
+</script>
+
+<style  scoped>
+.coupon{
+    padding: 10px;
+}
+.dflex{
+    display: flex;
+}
+.flex{
+    flex:1
+}
+.li {
+    background: #fff;
+    border-radius: 4px;
+    overflow: hidden;
+    border: 1px solid rgba(222, 222, 222, 1);
+    position: relative;
+}
+
+.lit {
+    height: 80px;
+    position: relative;
+}
+
+.lqbg {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    top: 0;
+    left: 0;
+    z-index: 1;
+}
+
+.lits {
+    position: relative;
+    z-index: 2;
+    padding: 16px 10px 0;
+}
+
+.left {
+    font-weight: bold;
+    font-size: 18px;
+    color: #fff;
+    font-weight: bold;
+    margin-right: 20px;
+}
+
+.left span {
+    font-size: 18px;
+    font-weight: normal;
+}
+
+.left span.jine {
+    font-size: 36px;
+    font-weight: bold;
+}
+
+.tong {
+    margin-top: 0px;
+}
+
+.tong div {
+    font-size: 16px;
+    color: #fff;
+    margin-bottom: 2px;
+}
+
+.tong span {
+    font-size: 14px;
+    color: #fff;
+}
+
+.lqbtn {
+    width: 90px;
+    height: 30px;
+    background: #fff;
+    border-radius: 35px;
+    line-height: 30px;
+    font-size: 14px;
+    color: #FF6008;
+    text-align: center;
+    margin: auto;
+
+}
+
+.right {
+    padding: 5px 30px;
+    font-size: 12px;
+    color: #9A9A9A;
+    overflow: hidden;
+}
+
+.right div {
+    position: relative;
+    margin-bottom: 5px;
+}
+
+.right div::before {
+    content: '';
+    display: block;
+    width: 8px;
+    height: 8px;
+    border-radius: 50%;
+    background: #888;
+    position: absolute;
+    left: -20px;
+    top: 50%;
+    transform: translateY(-50%);
+}
+
+.list .li.fail .lqbtn {
+    background: #A6A6A6;
+    color: #333;
+}
+
+.guoqi {
+    width: 187px;
+    height: 165px;
+    position: absolute;
+    right: 50px;
+    top: 6px;
+    z-index: 1;
+}
+</style>

+ 130 - 0
src/components/setting/settingCoupon.vue

@@ -0,0 +1,130 @@
+<template>
+    <div class="panel">
+        <div class="panel-header">
+            <h3 class="header-title">{{ data.name }}设置</h3>
+            <a class="el-icon-close close-btn" @click="closeRightTemplateHandle"></a>
+        </div>
+        <div>
+            <el-form label-position="top" ref="form" label-width="80px">
+                <el-form-item style="margin-bottom: 0;" label="选择优惠券">
+                    <el-select size="mini" @change="couponChange" v-model="selectId" placeholder="选择优惠券">
+                        <el-option label="请选择" value=""></el-option>
+                        <el-option :label="item.title" :value="item.id" v-for="item in couponList" :key="item.id">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+            </el-form>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'settingCoupon',
+    props: ['data', 'className'],
+    data() {
+        return {
+            content: JSON.parse(JSON.stringify(this.data)),
+            selectId:'',
+            couponList:[{
+                id:101,
+                title:'xxx优惠券'
+            },{
+                id:220,
+                title:'xxx2优惠券'
+            }]
+        }
+    },
+    created() {
+        this.getCouponList()
+        this.selectId = this.content.id?this.content.id:''
+    },
+    methods: {
+        // 获取优惠券列表
+        getCouponList() {
+            // service.get("/custom/form/column/list?formId=" + formId).then((res) => {
+            //     if (res.data.code != 0) {
+            //         return that.$message.error(res.data.data.msg);
+            //     }
+            //     this.formColumnList = res.data.data;
+            // }).catch(function () {
+            // });
+        },
+        couponChange(val){
+            console.log('val',val)
+            let obj = this.couponList.filter(item=>{return item.id==val})[0]
+            this.content.value.couponObj = obj
+            this.handleDate()
+        },
+        handleDate() {
+            this.$emit('updataContent', this.content)
+        },
+        closeRightTemplateHandle() {
+            this.$emit('closeRightTemplateHandle', false)
+        }
+    }
+}
+</script>
+
+<style  scoped>
+.panel {
+    padding: 0 10px;
+}
+
+.panel .panel-header {
+    position: relative;
+    height: 40px;
+    line-height: 40px;
+    margin-left: 8px;
+    margin-right: 8px;
+    vertical-align: middle;
+    border-bottom: 1px solid #dcdcdc;
+    box-sizing: border-box;
+    z-index: 10;
+}
+
+.panel .panel-header .header-title {
+    padding-left: 5px;
+    font-size: 14px;
+    color: #29304e;
+    position: relative;
+}
+
+.panel .panel-header .header-title:before {
+    content: "";
+    position: absolute;
+    top: 50%;
+    left: 0;
+    transform: translateY(-50%);
+    width: 3px;
+    height: 18px;
+    background: #1890ff;
+    opacity: 1;
+    border-radius: 2px;
+}
+
+.panel .panel-header .close-btn {
+    position: absolute;
+    top: 12px;
+    right: 0;
+    border: none;
+    outline: none;
+    cursor: pointer;
+    color: #999;
+    font-weight: 700;
+}
+
+.panel .panel-body {
+    position: absolute;
+    top: 40px;
+    bottom: 0;
+    width: 100%;
+    overflow-y: auto;
+}
+
+.text-setting {
+    display: flex;
+    justify-content: space-between;
+    margin: 10px 0;
+}
+</style>