Commit eeef1cdf by zhangquan

代码优化

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