You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
1.8 KiB
95 lines
1.8 KiB
<template>
|
|
<view class="">
|
|
<navigation :showBack="true" :bgnum="true">
|
|
{{i18n.curr2}}
|
|
</navigation>
|
|
<view class="main">
|
|
<view class="main_con">
|
|
<u-radio-group v-model="currency" @change="radioGroupChange">
|
|
<view class="item flex" v-for="(item, index) in list" :key="index" @click="handove('en')">
|
|
<view class="text1">
|
|
{{item.lang}}
|
|
</view>
|
|
<u-radio @change="radioChange" :name="item.name" :disabled="item.disabled"
|
|
active-color="#5B53FF">
|
|
|
|
</u-radio>
|
|
</view>
|
|
</u-radio-group>
|
|
|
|
<view class="select_btn" @click="confirmCurrency">
|
|
{{i18n.langSelect}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import cont from "@/components/navigation/navigation.vue"
|
|
export default {
|
|
data() {
|
|
return {
|
|
checked: false,
|
|
currency:'USD',
|
|
list: [{
|
|
lang: 'USD',
|
|
disabled: false,
|
|
name: "USD"
|
|
},
|
|
{
|
|
lang: 'CNY',
|
|
disabled: false,
|
|
name: "CNY"
|
|
},
|
|
|
|
],
|
|
// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
|
|
|
|
};
|
|
},
|
|
onLoad(){
|
|
let currency=uni.getStorageSync('currency');
|
|
if(currency){
|
|
this.currency=currency;
|
|
}else{
|
|
uni.setStorageSync('currency',this.currency)
|
|
}
|
|
},
|
|
methods: {
|
|
confirmCurrency(){
|
|
uni.setStorageSync('currency',this.currency)
|
|
uni.reLaunch({
|
|
url: '/pages/menu/setting/index'
|
|
})
|
|
},
|
|
handove(item) {
|
|
},
|
|
radioChange(e) {
|
|
// console.log(e);
|
|
},
|
|
// 选中任一radio时,由radio-group触发
|
|
radioGroupChange(e) {
|
|
console.log(this.currency)
|
|
},
|
|
change(status) {
|
|
// console.log(status);
|
|
},
|
|
},
|
|
computed: {
|
|
i18n() {
|
|
return this.$t('index')
|
|
}
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
page {
|
|
background: #FAFAFA;
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
@import './index.css';
|
|
</style>
|
|
|