Commit a77cf605 authored by chenwei's avatar chenwei

变更提货点接口

parent e8258cbd
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
<view class="select-list"> <view class="select-list">
<view class="list-item" v-for="(item, index) in netList" :key="index" <view class="list-item" v-for="(item, index) in netList" :key="index"
>{{ item }} >{{ item }}
<uni-icons <uni-icons class="list-icon" type="right" color="#B3B3B3" size="12"></uni-icons>
class="list-icon"
type="right"
color="#B3B3B3"
size="12"
></uni-icons>
</view> </view>
</view> </view>
<view class="select-right"> <view class="select-right">
...@@ -23,22 +18,12 @@ ...@@ -23,22 +18,12 @@
@columnchange="bindColumnChange" @columnchange="bindColumnChange"
> >
{{ $lang.lang.integral.outlets }} {{ $lang.lang.integral.outlets }}
<uni-icons <uni-icons class="list-icon" type="right" color="#B3B3B3" size="12"></uni-icons>
class="list-icon"
type="right"
color="#B3B3B3"
size="12"
></uni-icons>
</picker> </picker>
</view> </view>
</view> </view>
<view class="gift-content"> <view class="gift-content">
<view <view class="gift-item" v-for="item in giftList" :key="item.id" @click="toMail(item.id)">
class="gift-item"
v-for="item in giftList"
:key="item.id"
@click="toMail(item.id)"
>
<view class="gift-image-box"> <view class="gift-image-box">
<image <image
class="gift-image" class="gift-image"
...@@ -47,27 +32,17 @@ ...@@ -47,27 +32,17 @@
></image> ></image>
<view class="gift-tag"> <view class="gift-tag">
<view class="tags"> <view class="tags">
<image <image class="tag-image" src="../../../static/img/score.png"></image>
class="tag-image"
src="../../../static/img/score.png"
></image>
<view class="tag-text">{{ item.pointsRequire }}</view> <view class="tag-text">{{ item.pointsRequire }}</view>
</view> </view>
</view> </view>
<view class="foot-tag">{{ <view class="foot-tag">{{ $lang.lang.integral.remainder(item.quantityRemain) }}</view>
$lang.lang.integral.remainder(item.quantityRemain)
}}</view>
</view> </view>
<view class="gift-name">{{ <view class="gift-name">{{ locale === 'zh' ? item.titleZh : item.titleEn }}</view>
locale === "zh" ? item.titleZh : item.titleEn
}}</view>
<view class="gift-menu"> <view class="gift-menu">
<view <view class="gift-menu-text" v-for="ele in item.pickMethodList" :key="ele.id">{{
class="gift-menu-text" locale === 'zh' ? ele.labelZh : ele.labelEn
v-for="ele in item.pickMethodList" }}</view>
:key="ele.id"
>{{ locale === "zh" ? ele.labelZh : ele.labelEn }}</view
>
</view> </view>
</view> </view>
</view> </view>
...@@ -79,8 +54,8 @@ export default { ...@@ -79,8 +54,8 @@ export default {
props: { props: {
userInfo: { userInfo: {
type: Object, type: Object,
default: () => {}, default: () => {}
}, }
}, },
data() { data() {
return { return {
...@@ -89,142 +64,138 @@ export default { ...@@ -89,142 +64,138 @@ export default {
pickerData: [[], [], []], pickerData: [[], [], []],
pickerValue: [0, 0, 0], pickerValue: [0, 0, 0],
nodeId: null, nodeId: null,
netList: [], netList: []
}; }
}, },
computed: { computed: {
locale() { locale() {
return this.$lang.locale; return this.$lang.locale
}, }
}, },
watch: { watch: {
userInfo: { userInfo: {
handler(val) { handler(val) {
console.log(val); console.log(val)
this.netList = this.netList =
this.$lang.locale === "zh" this.$lang.locale === 'zh'
? [val.countryTitleZh, val.cityTitleZh] ? [val.countryTitleZh, val.cityTitleZh]
: [val.countryTitleEn, val.cityTitleEn]; : [val.countryTitleEn, val.cityTitleEn]
}, },
immediate: true, immediate: true
}, }
}, },
created() { created() {
this.getGift(); this.getGift()
this.getNet(); this.getNet()
}, },
methods: { methods: {
toMail(id) { toMail(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/order_mail/order_mail?id=" + id, url: '/pages/order_mail/order_mail?id=' + id
}); })
}, },
// 获取礼品列表 // 获取礼品列表
async getGift() { async getGift() {
try { try {
const memberId = this.$store.getters.id; const memberId = this.$store.getters.id
const { code, data } = await this.$request.post( const { code, data } = await this.$request.post('/app-api/ecw/reward/list', {
"/app-api/ecw/reward/list", memberId,
{ nodeId: this.nodeId
memberId, })
nodeId: this.nodeId,
}
);
if (code === 0) { if (code === 0) {
this.giftList = data.list; this.giftList = data.list
if (!this.nodeId) { if (!this.nodeId) {
if (data.city) { if (data.city) {
this.netList = this.netList =
this.$lang.locale === "zh" this.$lang.locale === 'zh'
? [this.userInfo.countryTitleZh, this.userInfo.cityTitleZh] ? [this.userInfo.countryTitleZh, this.userInfo.cityTitleZh]
: [this.userInfo.countryTitleEn, this.userInfo.cityTitleEn]; : [this.userInfo.countryTitleEn, this.userInfo.cityTitleEn]
} else if (data.country == "130") { } else if (data.country == '130') {
this.netList = this.$lang.locale === "zh" ? ["中国"] : ["china"]; this.netList = this.$lang.locale === 'zh' ? ['中国'] : ['china']
} else { } else {
this.netList = this.netList =
this.$lang.locale === "zh" this.$lang.locale === 'zh'
? [this.userInfo.countryTitleZh] ? [this.userInfo.countryTitleZh]
: [this.userInfo.countryTitleEn]; : [this.userInfo.countryTitleEn]
} }
} }
} }
console.log("giftList", this.giftList); console.log('giftList', this.giftList)
} catch (error) { } catch (error) {
console.log(error); console.log(error)
} }
}, },
// 获取网点列表 // 获取网点列表
async getNet() { async getNet() {
try { try {
const { code, data } = await this.$request.get( const { code, data } = await this.$request.get(
"/admin-api/ecw/node/get-node-tree-region" '/admin-api/member/score-rule/warehouse-tree-region-list'
); )
if (code === 0) { if (code === 0) {
this.data = data; this.data = data
this.initPickerData(); this.initPickerData()
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error)
} }
}, },
// 初始化选择器数据 // 初始化选择器数据
initPickerData() { initPickerData() {
if (this.data.length === 0) return; if (this.data.length === 0) return
const countries = this.data; const countries = this.data
const cities = this.data[0].children || []; const cities = this.data[0].children || []
const areas = const areas = (this.data[0].children && this.data[0].children[0].children) || []
(this.data[0].children && this.data[0].children[0].children) || []; this.pickerData[0] = countries
this.pickerData[0] = countries; this.pickerData[1] = cities
this.pickerData[1] = cities; this.pickerData[2] = areas
this.pickerData[2] = areas;
}, },
// 选择改变 // 选择改变
bindPickerChange(e) { bindPickerChange(e) {
const val = e.detail.value; const val = e.detail.value
this.pickerValue = val; this.pickerValue = val
this.nodeId = this.pickerData[2][val[2]].id; this.nodeId = this.pickerData[2][val[2]].id
this.getGift(); this.getGift()
this.getPickerValue(val); this.getPickerValue(val)
}, },
// 列改变 // 列改变
bindColumnChange(e) { bindColumnChange(e) {
const { column, value } = e.detail; const { column, value } = e.detail
const data = { const data = {
pickerData: this.pickerData, pickerData: this.pickerData,
pickerValue: this.pickerValue, pickerValue: this.pickerValue
}; }
data.pickerValue[column] = value; data.pickerValue[column] = value
if (column === 0) { if (column === 0) {
const selectedCountry = this.data[value]; const selectedCountry = this.data[value]
const cities = selectedCountry.children || []; const cities = selectedCountry.children || []
const areas = (cities[0] && cities[0].children) || []; const areas = (cities[0] && cities[0].children) || []
data.pickerData[1] = cities; data.pickerData[1] = cities
data.pickerData[2] = areas; data.pickerData[2] = areas
data.pickerValue[1] = 0; data.pickerValue[1] = 0
data.pickerValue[2] = 0; data.pickerValue[2] = 0
} else if (column === 1) { } else if (column === 1) {
const selectedCountry = this.data[data.pickerValue[0]]; const selectedCountry = this.data[data.pickerValue[0]]
const selectedCity = selectedCountry.children[value]; const selectedCity = selectedCountry.children[value]
const areas = selectedCity.children || []; const areas = selectedCity.children || []
data.pickerData[2] = areas; data.pickerData[2] = areas
data.pickerValue[2] = 0; data.pickerValue[2] = 0
} }
this.pickerData = data.pickerData; this.pickerData = data.pickerData
this.pickerValue = data.pickerValue; this.pickerValue = data.pickerValue
this.$forceUpdate(); this.$forceUpdate()
}, },
// 选择数据显示 // 选择数据显示
getPickerValue(val) { getPickerValue(val) {
const countries = this.pickerData[0][val[0]]; const countries = this.pickerData[0][val[0]]
const cities = this.pickerData[1][val[1]]; const cities = this.pickerData[1][val[1]]
const areas = this.pickerData[2][val[2]]; const areas = this.pickerData[2][val[2]]
this.netList = this.netList =
this.locale === "zh" this.locale === 'zh'
? [countries.labelZh, cities.labelZh, areas.labelZh] ? [countries.labelZh, cities.labelZh, areas.labelZh]
: [countries.labelEn, cities.labelEn, areas.labelEn]; : [countries.labelEn, cities.labelEn, areas.labelEn]
}, }
}, }
}; }
</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