Commit eeef1cdf by zhangquan

代码优化

1 parent 83e68a3a
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
</div> </div>
<div class="error_coupon"> <div class="error_coupon">
<div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index"> <div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index">
<img v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" /> <img class="r-margin" v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" /> <img class="r-margin" v-else src="@/assets/directCharge.png" alt="" />
<span class="info">【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{ item.newCost }}元</span> <span class="info">{{ item.newCost }}元【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{couponFormObj.effectiveDays}}天</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -222,6 +222,9 @@ export default { ...@@ -222,6 +222,9 @@ export default {
padding: 32px 30px; padding: 32px 30px;
min-height: calc(100vh - 190px); min-height: calc(100vh - 190px);
position: relative; position: relative;
.r-margin{
margin-right: 5px;
}
/deep/ .glsx-combi-form { /deep/ .glsx-combi-form {
padding-bottom: 30px; padding-bottom: 30px;
} }
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<div class="gift_item" v-for="(item, index) in val" :key="index"> <div class="gift_item" v-for="(item, index) in val" :key="index">
<img class="muti_icon" src="@/assets/muti-selected.png" @click="handleGiftDelete(key, item, index)" /> <img class="muti_icon" src="@/assets/muti-selected.png" @click="handleGiftDelete(key, item, index)" />
<!-- <img class="muti_icon" src="@/assets/muti-no-select.png" @click="handleGiftDelete(item, index)" /> --> <!-- <img class="muti_icon" src="@/assets/muti-no-select.png" @click="handleGiftDelete(item, index)" /> -->
<el-tooltip effect="dark" placement="top" :disabled="item.goodsName.length <= 8"> <el-tooltip effect="dark" placement="top" :disabled="item.goodsName.length <= 7">
<p :class="['gift_coupon_name', 'ellipsis-1', item.status == '3' ? 'txt-grey' : '']">{{ item.goodsName.length > 8 ? item.goodsName.slice(0, 8) + '...' : item.goodsName }}</p> <p :class="['gift_coupon_name', 'ellipsis-1', item.status == '3' ? 'txt-grey' : '']">{{ item.goodsName.length > 7 ? item.goodsName.slice(0, 7) + '...' : item.goodsName }}</p>
<div slot="content">{{ item.goodsName }}</div> <div slot="content">{{ item.goodsName }}</div>
</el-tooltip> </el-tooltip>
<div class="gift_sum"> <div class="gift_sum">
......
...@@ -121,7 +121,18 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -121,7 +121,18 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
}, },
mounted(){ mounted(){
this.getTemplateList() const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.getTemplateList().then(res=>{
loading.close()
}).catch(err=>{
loading.close()
})
window.addEventListener('resize', this.resizeDom); window.addEventListener('resize', this.resizeDom);
}, },
beforeDestroy(){ beforeDestroy(){
...@@ -169,14 +180,19 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -169,14 +180,19 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
}) })
}, },
getTemplateList(){ getTemplateList(){
this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => { return new Promise((resolve, reject) => {
if(res?.list?.length){ this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => {
this.curConfigId = res.list[0]?.id resolve(res)
this.handleOk() if(res?.list?.length){
this.templateList = res.list this.curConfigId = res.list[0]?.id
this.rowList = res.list this.handleOk()
this.calcWidth() this.templateList = res.list
} this.rowList = res.list
this.calcWidth()
}
}).catch(err=>{
reject(err)
})
}) })
}, },
addTemplate(){ addTemplate(){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!