|
@@ -9,7 +9,8 @@ import { useSelector } from 'react-redux'
|
|
|
|
|
|
|
|
export default function Component(props: {
|
|
export default function Component(props: {
|
|
|
themeColor: string, cancel: Function, confirm: Function, array: any, limit: any,
|
|
themeColor: string, cancel: Function, confirm: Function, array: any, limit: any,
|
|
|
- orders: any, newOrders: any
|
|
|
|
|
|
|
+ orders: any, newOrders: any,
|
|
|
|
|
+ isWorkout?: boolean
|
|
|
}) {
|
|
}) {
|
|
|
const color = props.themeColor ? props.themeColor : '#ff0000'
|
|
const color = props.themeColor ? props.themeColor : '#ff0000'
|
|
|
const user = useSelector((state: any) => state.user);
|
|
const user = useSelector((state: any) => state.user);
|
|
@@ -36,13 +37,13 @@ export default function Component(props: {
|
|
|
for (var i = 0; i < newList.length; i++) {
|
|
for (var i = 0; i < newList.length; i++) {
|
|
|
array.push(newList[i])
|
|
array.push(newList[i])
|
|
|
}
|
|
}
|
|
|
- console.log(oldList,newList,array)
|
|
|
|
|
|
|
+ console.log(oldList, newList, array)
|
|
|
debugger
|
|
debugger
|
|
|
- props.confirm(oldList,newList,array,list)
|
|
|
|
|
|
|
+ props.confirm(oldList, newList, array, list)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function tapItem(obj) {
|
|
function tapItem(obj) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
var check = !obj.is_following
|
|
var check = !obj.is_following
|
|
|
var count = 0;
|
|
var count = 0;
|
|
|
oldList.map(item => {
|
|
oldList.map(item => {
|
|
@@ -60,7 +61,7 @@ export default function Component(props: {
|
|
|
if (max == count) {
|
|
if (max == count) {
|
|
|
Taro.showToast({
|
|
Taro.showToast({
|
|
|
icon: 'none',
|
|
icon: 'none',
|
|
|
- title:`高级会员可选择${count}项以上`
|
|
|
|
|
|
|
+ title: `高级会员可选择${count}项以上`
|
|
|
// title: t('feature.common.toast.max_metric_count',{count:count}),
|
|
// title: t('feature.common.toast.max_metric_count',{count:count}),
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
@@ -70,7 +71,7 @@ export default function Component(props: {
|
|
|
if (min == count) {
|
|
if (min == count) {
|
|
|
Taro.showToast({
|
|
Taro.showToast({
|
|
|
icon: 'none',
|
|
icon: 'none',
|
|
|
- title: t('feature.common.toast.min_metric_count',{count:count}),
|
|
|
|
|
|
|
+ title: t('feature.common.toast.min_metric_count', { count: count }),
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -125,7 +126,7 @@ export default function Component(props: {
|
|
|
return ''
|
|
return ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function codeNewIndex(code){
|
|
|
|
|
|
|
+ function codeNewIndex(code) {
|
|
|
for (var i = 0; i < newList.length; i++) {
|
|
for (var i = 0; i < newList.length; i++) {
|
|
|
if (newList[i].code == code) {
|
|
if (newList[i].code == code) {
|
|
|
return `序号:${i + 1 + oldList.length}`;
|
|
return `序号:${i + 1 + oldList.length}`;
|
|
@@ -134,7 +135,7 @@ export default function Component(props: {
|
|
|
return ''
|
|
return ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function codeOldIndex(code){
|
|
|
|
|
|
|
+ function codeOldIndex(code) {
|
|
|
for (var i = 0; i < oldList.length; i++) {
|
|
for (var i = 0; i < oldList.length; i++) {
|
|
|
if (oldList[i].code == code) {
|
|
if (oldList[i].code == code) {
|
|
|
return `序号:${i + 1}`;
|
|
return `序号:${i + 1}`;
|
|
@@ -146,8 +147,8 @@ export default function Component(props: {
|
|
|
|
|
|
|
|
return <View className='modal_content'>
|
|
return <View className='modal_content'>
|
|
|
<View className='modal_title_view'>
|
|
<View className='modal_title_view'>
|
|
|
- <Text className='modal_title1'>{t('feature.track_something.metric.choose_metric')}</Text>
|
|
|
|
|
- <Text className='modal_subtitle'>按需选择自己常用的指标</Text>
|
|
|
|
|
|
|
+ <Text className='modal_title1'>{props.isWorkout ? t('feature.workout.choose_workout') : t('feature.track_something.metric.choose_metric')}</Text>
|
|
|
|
|
+ <Text className='modal_subtitle'>{props.isWorkout?t('feature.workout.choose_workout_desc'):'按需选择自己常用的指标'}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
<ScrollView className='modal_detail' scrollY>
|
|
<ScrollView className='modal_detail' scrollY>
|
|
|
<View>
|
|
<View>
|
|
@@ -167,13 +168,13 @@ export default function Component(props: {
|
|
|
{
|
|
{
|
|
|
user.test_user && <Text>{obj.is_following ? codeIndex(obj.code) : ''}</Text>
|
|
user.test_user && <Text>{obj.is_following ? codeIndex(obj.code) : ''}</Text>
|
|
|
}
|
|
}
|
|
|
- {
|
|
|
|
|
- user.test_user && <Text style={{color:'green'}}>{obj.is_following ? codeNewIndex(obj.code) : ''}</Text>
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ user.test_user && <Text style={{ color: 'green' }}>{obj.is_following ? codeNewIndex(obj.code) : ''}</Text>
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- user.test_user && <Text style={{color:'red'}}>{!obj.is_following && codeOldIndex(obj.code)}</Text>
|
|
|
|
|
|
|
+ user.test_user && <Text style={{ color: 'red' }}>{!obj.is_following && codeOldIndex(obj.code)}</Text>
|
|
|
}
|
|
}
|
|
|
- <View className='px1SeperateHeight'/>
|
|
|
|
|
|
|
+ <View className='px1SeperateHeight' />
|
|
|
</View>
|
|
</View>
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|