Commit 78542170 authored by chenwei's avatar chenwei

更改提货点接口


(cherry picked from commit 35f6dad3)
parent 904471eb
......@@ -26,7 +26,14 @@ export function getBranchList(params) {
params,
});
}
// 获取提货点的接口
export function getWarehouseList(params) {
return request({
url: "/admin-api/member/score-rule/warehouse-tree-region-list",
method: "get",
params,
});
}
// 获取积分活动列表
export function integralActivityList(data) {
return request({
......
......@@ -31,10 +31,10 @@
class="imgs"
:src="language == 'zh_CN' ? item.imgZh : item.imgEn"
alt=""
>
/>
<div class="gift-tag">
<div class="tags">
<img class="tag-image" src="@/assets/integral/score.png">
<img class="tag-image" src="@/assets/integral/score.png" />
<div class="tag-text">{{ item.pointsRequire }}</div>
</div>
</div>
......@@ -62,10 +62,10 @@
</template>
<script>
import { integralList, getBranchList } from '@/api/integral'
import { integralList, getWarehouseList } from "@/api/integral";
export default {
name: 'IntegralExchange',
name: "IntegralExchange",
data() {
return {
list: [],
......@@ -73,73 +73,73 @@ export default {
nodeList: [],
selectedNodeId: null,
checkStrictly: true,
cascaderState: true
}
cascaderState: true,
};
},
computed: {
language() {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.cascaderState = false
this.cascaderState = false;
this.$nextTick(() => {
this.cascaderState = true
})
return this.$store.getters.language
}
this.cascaderState = true;
});
return this.$store.getters.language;
},
},
watch: {
selectedNodeId(val) {
if (val && val.length > 2) {
this.nodeId = val[val.length - 1]
this.getIntegralList()
}
this.nodeId = val[val.length - 1];
this.getIntegralList();
}
},
},
created() {
this.getIntegralList()
this.getNodeInfo()
this.getIntegralList();
this.getNodeInfo();
},
methods: {
changeSelect() {
this.checkStrictly = false
this.checkStrictly = false;
},
// 获取礼品列表
async getIntegralList() {
try {
const memberId = this.$store.getters.id
const memberId = this.$store.getters.id;
const { code, data } = await integralList({
memberId,
nodeId: this.nodeId
})
if (code !== 0) return
this.list = data.list
nodeId: this.nodeId,
});
if (code !== 0) return;
this.list = data.list;
if (!this.nodeId) {
if (data.city) {
this.selectedNodeId = [data.country, data.city]
this.selectedNodeId = [data.country, data.city];
} else {
this.selectedNodeId = [data.country]
this.selectedNodeId = [data.country];
}
}
} catch (err) {
console.log(err)
console.log(err);
}
},
// 获取网点信息
async getNodeInfo() {
try {
const { code, data } = await getBranchList()
if (code !== 0) return
this.nodeList = data
console.log(data)
const { code, data } = await getWarehouseList();
if (code !== 0) return;
this.nodeList = data;
console.log(data);
} catch (err) {
console.log(err)
console.log(err);
}
},
// 跳转详情
toDetail(id) {
this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id }})
}
}
}
this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id } });
},
},
};
</script>
<style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment