Commit ec9b5cf6 authored by chenwei's avatar chenwei

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

parent 19fb9f79
......@@ -10,7 +10,7 @@
</view>
<view class="container-main">
<view class="activity-title">{{
locale === "zh" ? detailInfo.titleZh : detailInfo.titleEn
locale === 'zh' ? detailInfo.titleZh : detailInfo.titleEn
}}</view>
<view
class="activity-remark"
......@@ -46,7 +46,7 @@
low: ruleItem.low,
high: ruleItem.high,
score: ruleItem.score,
unit: detailInfo.extraOrderVtransportType == 1 ? "" : "kg"
unit: detailInfo.extraOrderV.transportType == 1 ? '' : 'kg'
})
}}
</view>
......@@ -69,7 +69,7 @@
<view class="activity-cell">
<view class="cell-label">{{ detail.rulesIllustrate }}</view>
<view class="cell-content">
{{ locale === "zh" ? detailInfo.descZh : detailInfo.descEn }}
{{ locale === 'zh' ? detailInfo.descZh : detailInfo.descEn }}
</view>
</view>
</view>
......@@ -78,7 +78,7 @@
</template>
<script>
import dHeader from "../../components/dHeader/index.vue"
import dHeader from '../../components/dHeader/index.vue'
export default {
components: {
dHeader
......@@ -106,7 +106,7 @@ export default {
// 获取详情
getDetail() {
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 }) => {
if (code === 0 && data) {
this.detailInfo = data
......@@ -115,15 +115,14 @@ export default {
},
// 时间范围返回
getTimeRange(start, end) {
const formatDate = (timestamp) => {
const date = new Date(timestamp)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
const hours = String(date.getHours()).padStart(2, "0")
const minutes = String(date.getMinutes()).padStart(2, "0")
const seconds = String(date.getSeconds()).padStart(2, "0")
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day}`
}
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 @@
<view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.city }}</text>
</view>
<view class="consult-item-put">
<picker
style="width: 100%"
:range="cityArray"
:range-key="rangeKey == 'zh' ? 'titleZh' : 'titleEn'"
@change="bindCityChange"
>
<view :class="{ placeholder: !params.city }">{{
params.cityValue ? params.cityValue : $lang.lang.notices.city
}}</view>
</picker>
<view class="consult-item-put" @click="showCityPicker">
<view :class="{ placeholder: !params.city }">
{{ params.cityValue || $lang.lang.notices.city }}
</view>
<image class="rgt" src="../../static/img/rgt.png" mode=""></image>
</view>
<cityListPicker
v-model="cityPickerPopup"
:dataSource="cityArray"
:pickerValues="params.city"
@reLoad="changeCity"
></cityListPicker>
</view>
<view class="consult-item">
<view class="consult-item-label">
......@@ -150,9 +149,11 @@
<script>
import dHeader from '../../components/dHeader/index.vue'
import cityListPicker from './cityListPicker.vue'
export default {
components: {
dHeader
dHeader,
cityListPicker
},
data() {
const currentDate = this.getDate({
......@@ -177,7 +178,8 @@ export default {
// 城市列表
cityArray: [],
// 是否为首次进入 没有国家城市信息
first: false
first: false,
cityPickerPopup: false //城市下拉列表展示
}
},
onLoad(route) {
......@@ -198,7 +200,22 @@ export default {
return this.$lang.locale == 'zh' ? 'zh' : 'en'
}
},
watch: {
cityPickerPopup(newValue, oldValue) {
console.log('99999', newValue)
}
},
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() {
if (!this.params.nickname) {
uni.showToast({
......@@ -264,6 +281,11 @@ export default {
}
const { city, country, countryTitleZh, countryTitleEn, cityTitleZh, cityTitleEn } =
res.data
if (this.first) {
this.params.nickname = ''
this.params.englishName = ''
}
this.params.city = city
this.params.country = country
this.params.cityValue = this.rangeKey == 'zh' ? cityTitleZh : cityTitleEn
......@@ -351,14 +373,6 @@ export default {
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 {
"info": "persoal information",
"name": "name",
"nameEn": "English name",
"birth": "birthday",
"sex": "gender",
"phone": "phone number",
"adderss": "address",
"department": "department",
"job": "job position",
"edit": "edit",
"girl": "female",
"boy": "male",
"secret": "classifield",
"country": "country",
"city": "city"
info: 'persoal information',
name: 'name',
nameEn: 'English name',
birth: 'birthday',
sex: 'gender',
phone: 'phone number',
adderss: 'address',
department: 'department',
job: 'job position',
edit: 'edit',
girl: 'female',
boy: 'male',
secret: 'classifield',
country: 'country',
city: 'city',
confirm: 'confirm',
cancel: 'cancel',
placeholder: 'placeholder'
}
export default {
"info": "个人信息",
"name": "姓名",
"nameEn": "英文名",
"birth": "生日",
"sex": "性别",
"phone": "电话",
"adderss": "地址",
"department": "部门",
"job": "岗位",
"edit": "修改",
"girl": "",
"boy": "",
"secret": "保密",
"country": "国家",
"city": "城市"
info: '个人信息',
name: '姓名',
nameEn: '英文名',
birth: '生日',
sex: '性别',
phone: '电话',
adderss: '地址',
department: '部门',
job: '岗位',
edit: '修改',
girl: '',
boy: '',
secret: '保密',
country: '国家',
city: '城市',
confirm: '确认',
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