Commit 78542170 authored by chenwei's avatar chenwei

更改提货点接口


(cherry picked from commit 35f6dad3)
parent 904471eb
...@@ -26,7 +26,14 @@ export function getBranchList(params) { ...@@ -26,7 +26,14 @@ export function getBranchList(params) {
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) { export function integralActivityList(data) {
return request({ return request({
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
class="imgs" class="imgs"
:src="language == 'zh_CN' ? item.imgZh : item.imgEn" :src="language == 'zh_CN' ? item.imgZh : item.imgEn"
alt="" alt=""
> />
<div class="gift-tag"> <div class="gift-tag">
<div class="tags"> <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 class="tag-text">{{ item.pointsRequire }}</div>
</div> </div>
</div> </div>
...@@ -62,10 +62,10 @@ ...@@ -62,10 +62,10 @@
</template> </template>
<script> <script>
import { integralList, getBranchList } from '@/api/integral' import { integralList, getWarehouseList } from "@/api/integral";
export default { export default {
name: 'IntegralExchange', name: "IntegralExchange",
data() { data() {
return { return {
list: [], list: [],
...@@ -73,73 +73,73 @@ export default { ...@@ -73,73 +73,73 @@ export default {
nodeList: [], nodeList: [],
selectedNodeId: null, selectedNodeId: null,
checkStrictly: true, checkStrictly: true,
cascaderState: true cascaderState: true,
} };
}, },
computed: { computed: {
language() { language() {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties // eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.cascaderState = false this.cascaderState = false;
this.$nextTick(() => { this.$nextTick(() => {
this.cascaderState = true this.cascaderState = true;
}) });
return this.$store.getters.language return this.$store.getters.language;
} },
}, },
watch: { watch: {
selectedNodeId(val) { selectedNodeId(val) {
if (val && val.length > 2) { if (val && val.length > 2) {
this.nodeId = val[val.length - 1] this.nodeId = val[val.length - 1];
this.getIntegralList() this.getIntegralList();
}
} }
}, },
},
created() { created() {
this.getIntegralList() this.getIntegralList();
this.getNodeInfo() this.getNodeInfo();
}, },
methods: { methods: {
changeSelect() { changeSelect() {
this.checkStrictly = false this.checkStrictly = false;
}, },
// 获取礼品列表 // 获取礼品列表
async getIntegralList() { async getIntegralList() {
try { try {
const memberId = this.$store.getters.id const memberId = this.$store.getters.id;
const { code, data } = await integralList({ const { code, data } = await integralList({
memberId, memberId,
nodeId: this.nodeId nodeId: this.nodeId,
}) });
if (code !== 0) return if (code !== 0) return;
this.list = data.list this.list = data.list;
if (!this.nodeId) { if (!this.nodeId) {
if (data.city) { if (data.city) {
this.selectedNodeId = [data.country, data.city] this.selectedNodeId = [data.country, data.city];
} else { } else {
this.selectedNodeId = [data.country] this.selectedNodeId = [data.country];
} }
} }
} catch (err) { } catch (err) {
console.log(err) console.log(err);
} }
}, },
// 获取网点信息 // 获取网点信息
async getNodeInfo() { async getNodeInfo() {
try { try {
const { code, data } = await getBranchList() const { code, data } = await getWarehouseList();
if (code !== 0) return if (code !== 0) return;
this.nodeList = data this.nodeList = data;
console.log(data) console.log(data);
} catch (err) { } catch (err) {
console.log(err) console.log(err);
} }
}, },
// 跳转详情 // 跳转详情
toDetail(id) { toDetail(id) {
this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id }}) this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id } });
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <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