添加佛前供灯
This commit is contained in:
@@ -20,14 +20,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getOrderCompare } from "@/api";
|
||||
import { getOrderCompare, getOrderCompareByAgentId } from "@/api";
|
||||
export default {
|
||||
name: 'thanks-giving',
|
||||
props: {
|
||||
templeId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
templeId: [String, Number],
|
||||
goodsType: {
|
||||
type: String,
|
||||
},
|
||||
@@ -36,7 +33,9 @@ export default {
|
||||
},
|
||||
typeId: {
|
||||
type: [String, Number]
|
||||
}
|
||||
},
|
||||
agentId: [String, Number],
|
||||
|
||||
},
|
||||
|
||||
data(){
|
||||
@@ -65,7 +64,12 @@ export default {
|
||||
this.getOrderCompare();
|
||||
},
|
||||
async getOrderCompare(){
|
||||
const res = await getOrderCompare(this.templeId || '1', this.type_id, this.goodsId, this.goodsType)
|
||||
let res;
|
||||
if(this.templeId){
|
||||
res = await getOrderCompare(this.templeId || '1', this.type_id, this.goodsId, this.goodsType)
|
||||
} else {
|
||||
res = await getOrderCompareByAgentId(this.agentId, this.type_id, this.goodsId, this.goodsType)
|
||||
}
|
||||
const current = this.type_nav.find(item => item.id === this.type_id);
|
||||
current.list = res.list
|
||||
},
|
||||
|
||||
@@ -38,6 +38,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
name: '',
|
||||
names: [],
|
||||
selectedName: [],
|
||||
@@ -46,7 +47,6 @@ export default {
|
||||
watch: {
|
||||
visible(value){
|
||||
if(value){
|
||||
|
||||
this.selectedName = this.selected.map(v => v.id)
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,15 @@ export default {
|
||||
const data = await getMeritName();
|
||||
this.names = data;
|
||||
},
|
||||
onConfirmMeritName() {
|
||||
async onConfirmMeritName() {
|
||||
if(this.name){
|
||||
const name = this.name;
|
||||
await this.addName(this.name);
|
||||
const selected = this.names.filter(item => item.name === name);
|
||||
this.onClose();
|
||||
this.$emit('change', selected);
|
||||
return ;
|
||||
}
|
||||
const selected = this.names.filter(item => this.selectedName.includes(item.id));
|
||||
this.onClose();
|
||||
this.$emit('change', selected);
|
||||
@@ -124,14 +132,14 @@ export default {
|
||||
height: 30vh;
|
||||
span {
|
||||
display: inline-block;
|
||||
padding: .2rem .3rem;
|
||||
padding: .3rem .6rem;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: .08rem;
|
||||
position: relative;
|
||||
margin-right: .2rem;
|
||||
margin-bottom: .2rem;
|
||||
font-size: .35rem;
|
||||
font-size: .4rem;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
|
||||
@@ -139,7 +147,7 @@ export default {
|
||||
position: absolute;
|
||||
right: -.25rem;
|
||||
top: -.25rem;
|
||||
font-size: .5rem;
|
||||
font-size: .7rem;
|
||||
color: red;
|
||||
}
|
||||
input[type=checkbox]{
|
||||
|
||||
Reference in New Issue
Block a user