Commit ec9b5cf6 authored by chenwei's avatar chenwei

fexed defect | 590 509 | APP与web端 个人设置页面 & 海运拼柜的订单v值活动详情中积分说明单位错误

parent 19fb9f79
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
<view class="container-main"> <view class="container-main">
<view class="activity-title">{{ <view class="activity-title">{{
locale === "zh" ? detailInfo.titleZh : detailInfo.titleEn locale === 'zh' ? detailInfo.titleZh : detailInfo.titleEn
}}</view> }}</view>
<view <view
class="activity-remark" class="activity-remark"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<view class="cell-content"> <view class="cell-content">
<image class="cell-image" src="../../static/img/score_b.png"></image> <image class="cell-image" src="../../static/img/score_b.png"></image>
<span v-if="detailInfo.type == 4">{{ <span v-if="detailInfo.type == 4">{{
detail.shareLabel(detailInfo.getScoreOnce) detail.shareLabel(detailInfo.getScoreOnce)
}}</span> }}</span>
<span v-if="detailInfo.type == 3">{{ <span v-if="detailInfo.type == 3">{{
detail.referralCodeLabel(detailInfo.getScoreOnce) detail.referralCodeLabel(detailInfo.getScoreOnce)
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
low: ruleItem.low, low: ruleItem.low,
high: ruleItem.high, high: ruleItem.high,
score: ruleItem.score, score: ruleItem.score,
unit: detailInfo.extraOrderVtransportType == 1 ? "" : "kg" unit: detailInfo.extraOrderV.transportType == 1 ? '' : 'kg'
}) })
}} }}
</view> </view>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<view class="activity-cell"> <view class="activity-cell">
<view class="cell-label">{{ detail.rulesIllustrate }}</view> <view class="cell-label">{{ detail.rulesIllustrate }}</view>
<view class="cell-content"> <view class="cell-content">
{{ locale === "zh" ? detailInfo.descZh : detailInfo.descEn }} {{ locale === 'zh' ? detailInfo.descZh : detailInfo.descEn }}
</view> </view>
</view> </view>
</view> </view>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</template> </template>
<script> <script>
import dHeader from "../../components/dHeader/index.vue" import dHeader from '../../components/dHeader/index.vue'
export default { export default {
components: { components: {
dHeader dHeader
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
// 获取详情 // 获取详情
getDetail() { getDetail() {
this.$request this.$request
.post("/app-api/member/score-rule/get", { id: this.id }) .post('/app-api/member/score-rule/get', { id: this.id })
.then(({ code, data }) => { .then(({ code, data }) => {
if (code === 0 && data) { if (code === 0 && data) {
this.detailInfo = data this.detailInfo = data
...@@ -115,15 +115,14 @@ export default { ...@@ -115,15 +115,14 @@ export default {
}, },
// 时间范围返回 // 时间范围返回
getTimeRange(start, end) { getTimeRange(start, end) {
const formatDate = (timestamp) => { const formatDate = (timestamp) => {
const date = new Date(timestamp) const date = new Date(timestamp)
const year = date.getFullYear() const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0") const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, "0") const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, "0") const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, "0") const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, "0") const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day}` return `${year}-${month}-${day}`
} }
return `${formatDate(start)}${this.detail.to}${formatDate(end)}` return `${formatDate(start)}${this.detail.to}${formatDate(end)}`
......
<template>
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0" @maskClick="hiddeDatePicker">
<view class="date-container">
<view class="transparent">
<view class="date-confirm">
<view @click="hiddeDatePicker" class="pickerCancel">{{ $lang.lang.myInfo.cancel }}</view>
<!-- 输入框 -->
<input
style="width: 70%"
:placeholder="$lang.lang.myInfo.placeholder"
:show-action="false"
v-model="searchValue"
shape="round"
/>
<view @click="confirm" class="pickerConfirm">{{ $lang.lang.myInfo.confirm }}</view>
</view>
<picker-view
:immediate-change="true"
indicator-class="indicator"
:value="setValues"
@change="bindChange"
style="height: 430rpx"
>
<picker-view-column>
<view v-for="item in list" :key="item.id" class="u-column-item"
>{{ rangeKey == 'zh' ? item.titleZh : item.titleEn }}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
props: {
dataSource: {
type: Array,
default() {
return []
}
},
pickerValues: {
//picker默认展示的值
type: String | Number,
default: ''
},
value: {
type: Boolean,
default: false
}
},
computed: {
rangeKey() {
return this.$lang.locale == 'zh' ? 'zh' : 'en'
}
},
data() {
return {
searchValue: '', // 搜索值
setValues: [], // picker 选择值
form: {
//要传过去的值
id: '',
name: ''
},
list: this.dataSource
}
},
onLoad(option) {},
watch: {
dataSource: {
handler(newValue, oldValue) {
this.list = newValue
},
deep: true,
immediate: true
},
value(newValue, oldValue) {
this.init()
if (newValue) {
this.$refs.popup.open('bottom')
} else {
this.$refs.popup.close()
}
},
searchValue: {
handler(newValue, oldValue) {
this.reset()
if (!newValue) {
this.list = this.dataSource
} else {
this.list = this.dataSource.filter((item) => {
const title = this.rangeKey == 'zh' ? item.titleZh : item.titleEn
return title.includes(this.searchValue)
})
}
}
}
},
methods: {
init() {
this.$nextTick(() => {
//组件渲染完成后在更新数据
const index = this.list.findIndex((item) => item.id == this.pickerValues)
this.setValues = index > 0 ? [index] : [0]
})
},
bindChange(e) {
let value = e.detail.value.toString()
this.list.forEach((item, index) => {
if (value == index) {
this.form.id = item.id
this.form.name = this.rangeKey == 'zh' ? item.titleZh : item.titleEn
}
})
},
hiddeDatePicker() {
this.searchValue = ''
this.$emit('input', false)
},
confirm(e) {
if (this.form.id == '' && this.list.length > 0) {
this.form = {
id: this.list[0].id,
name: this.rangeKey == 'zh' ? this.list[0].titleZh : this.list[0].titleEn
}
}
console.log('ocfkfd', this.setValues)
this.hiddeDatePicker()
this.$emit('reLoad', this.form)
},
// 搜索查询
async searchChange(e) {
this.reset()
},
reset() {
//重置
this.form = {
id: '',
name: ''
}
}
}
}
</script>
<style lang="scss" scoped>
.date-container {
width: 100%;
background: #fff;
}
.date-confirm {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
font-size: 34rpx;
line-height: 100rpx;
z-index: 2;
height: 70rpx;
}
::v-deep .indicator {
height: 100rpx;
}
.pickerCancel {
font-size: 30rpx;
color: #606266;
box-sizing: border-box;
text-align: center;
text-decoration: none;
padding: 0rpx 8rpx;
}
.pickerConfirm {
font-size: 30rpx;
color: #2979ff;
box-sizing: border-box;
text-align: center;
text-decoration: none;
padding: 0rpx 8rpx;
}
.u-column-item {
line-height: 100rpx;
text-align: center;
}
</style>
...@@ -99,19 +99,18 @@ ...@@ -99,19 +99,18 @@
<view class="consult-item-label required-icon"> <view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.city }}</text> <text>{{ $lang.lang.myInfo.city }}</text>
</view> </view>
<view class="consult-item-put"> <view class="consult-item-put" @click="showCityPicker">
<picker <view :class="{ placeholder: !params.city }">
style="width: 100%" {{ params.cityValue || $lang.lang.notices.city }}
:range="cityArray" </view>
:range-key="rangeKey == 'zh' ? 'titleZh' : 'titleEn'"
@change="bindCityChange"
>
<view :class="{ placeholder: !params.city }">{{
params.cityValue ? params.cityValue : $lang.lang.notices.city
}}</view>
</picker>
<image class="rgt" src="../../static/img/rgt.png" mode=""></image> <image class="rgt" src="../../static/img/rgt.png" mode=""></image>
</view> </view>
<cityListPicker
v-model="cityPickerPopup"
:dataSource="cityArray"
:pickerValues="params.city"
@reLoad="changeCity"
></cityListPicker>
</view> </view>
<view class="consult-item"> <view class="consult-item">
<view class="consult-item-label"> <view class="consult-item-label">
...@@ -150,9 +149,11 @@ ...@@ -150,9 +149,11 @@
<script> <script>
import dHeader from '../../components/dHeader/index.vue' import dHeader from '../../components/dHeader/index.vue'
import cityListPicker from './cityListPicker.vue'
export default { export default {
components: { components: {
dHeader dHeader,
cityListPicker
}, },
data() { data() {
const currentDate = this.getDate({ const currentDate = this.getDate({
...@@ -177,7 +178,8 @@ export default { ...@@ -177,7 +178,8 @@ export default {
// 城市列表 // 城市列表
cityArray: [], cityArray: [],
// 是否为首次进入 没有国家城市信息 // 是否为首次进入 没有国家城市信息
first: false first: false,
cityPickerPopup: false //城市下拉列表展示
} }
}, },
onLoad(route) { onLoad(route) {
...@@ -198,7 +200,22 @@ export default { ...@@ -198,7 +200,22 @@ export default {
return this.$lang.locale == 'zh' ? 'zh' : 'en' return this.$lang.locale == 'zh' ? 'zh' : 'en'
} }
}, },
watch: {
cityPickerPopup(newValue, oldValue) {
console.log('99999', newValue)
}
},
methods: { methods: {
//变更城市
changeCity(e) {
this.$set(this.params, 'cityValue', e.name)
this.$set(this.params, 'city', e.id)
console.log('000008', e)
},
//弹出城市下拉筛选列表
showCityPicker() {
this.cityPickerPopup = true
},
submitForm() { submitForm() {
if (!this.params.nickname) { if (!this.params.nickname) {
uni.showToast({ uni.showToast({
...@@ -264,6 +281,11 @@ export default { ...@@ -264,6 +281,11 @@ export default {
} }
const { city, country, countryTitleZh, countryTitleEn, cityTitleZh, cityTitleEn } = const { city, country, countryTitleZh, countryTitleEn, cityTitleZh, cityTitleEn } =
res.data res.data
if (this.first) {
this.params.nickname = ''
this.params.englishName = ''
}
this.params.city = city this.params.city = city
this.params.country = country this.params.country = country
this.params.cityValue = this.rangeKey == 'zh' ? cityTitleZh : cityTitleEn this.params.cityValue = this.rangeKey == 'zh' ? cityTitleZh : cityTitleEn
...@@ -351,14 +373,6 @@ export default { ...@@ -351,14 +373,6 @@ export default {
this.cityArray = res.data this.cityArray = res.data
} }
}) })
},
// 城市选择 change
bindCityChange(e) {
const index = e.detail.value
const { titleZh, titleEn, id } = this.cityArray[index]
const value = this.rangeKey == 'zh' ? titleZh : titleEn
this.$set(this.params, 'cityValue', value)
this.$set(this.params, 'city', id)
} }
} }
} }
......
export default { export default {
"info": "persoal information", info: 'persoal information',
"name": "name", name: 'name',
"nameEn": "English name", nameEn: 'English name',
"birth": "birthday", birth: 'birthday',
"sex": "gender", sex: 'gender',
"phone": "phone number", phone: 'phone number',
"adderss": "address", adderss: 'address',
"department": "department", department: 'department',
"job": "job position", job: 'job position',
"edit": "edit", edit: 'edit',
"girl": "female", girl: 'female',
"boy": "male", boy: 'male',
"secret": "classifield", secret: 'classifield',
"country": "country", country: 'country',
"city": "city" city: 'city',
} confirm: 'confirm',
\ No newline at end of file cancel: 'cancel',
placeholder: 'placeholder'
}
export default { export default {
"info": "个人信息", info: '个人信息',
"name": "姓名", name: '姓名',
"nameEn": "英文名", nameEn: '英文名',
"birth": "生日", birth: '生日',
"sex": "性别", sex: '性别',
"phone": "电话", phone: '电话',
"adderss": "地址", adderss: '地址',
"department": "部门", department: '部门',
"job": "岗位", job: '岗位',
"edit": "修改", edit: '修改',
"girl": "", girl: '',
"boy": "", boy: '',
"secret": "保密", secret: '保密',
"country": "国家", country: '国家',
"city": "城市" city: '城市',
} confirm: '确认',
\ No newline at end of file cancel: '取消',
placeholder: '请输入'
}
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