|
@@ -1,4 +1,4 @@
|
|
|
-import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot } from "@tarojs/components";
|
|
|
|
|
|
|
+import { View, Image, PageMeta, NavigationBar, Input, Textarea, ScrollView, Snapshot, PickerView, PickerViewColumn,Text } from "@tarojs/components";
|
|
|
import './log_record.scss'
|
|
import './log_record.scss'
|
|
|
import { useEffect, useState } from "react";
|
|
import { useEffect, useState } from "react";
|
|
|
import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
|
|
import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
|
|
@@ -23,6 +23,7 @@ import PickerCard from "../components/picker_card";
|
|
|
import { IconCamera, IconClock } from "../components/record_icon";
|
|
import { IconCamera, IconClock } from "../components/record_icon";
|
|
|
// import QuickLog from "../components/quick_log";
|
|
// import QuickLog from "../components/quick_log";
|
|
|
import FollowInfo from "@/_moment/components/follow_info";
|
|
import FollowInfo from "@/_moment/components/follow_info";
|
|
|
|
|
+import NewDateTimePicker from "@/_health/base/new_date_time_picker";
|
|
|
|
|
|
|
|
let useRoute;
|
|
let useRoute;
|
|
|
let useNavigation;
|
|
let useNavigation;
|
|
@@ -32,9 +33,14 @@ if (process.env.TARO_ENV == 'rn') {
|
|
|
useNavigation = require("@react-navigation/native").useNavigation
|
|
useNavigation = require("@react-navigation/native").useNavigation
|
|
|
LinearGradient = require('react-native-linear-gradient').default
|
|
LinearGradient = require('react-native-linear-gradient').default
|
|
|
}
|
|
}
|
|
|
|
|
+let useActionSheet;
|
|
|
|
|
+if (process.env.TARO_ENV == 'rn') {
|
|
|
|
|
+ useActionSheet = require('@expo/react-native-action-sheet').useActionSheet
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export default function LogRecord({ route }) {
|
|
export default function LogRecord({ route }) {
|
|
|
const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
|
- const navigationBarHeight = systemInfo.statusBarHeight + 44 ;
|
|
|
|
|
|
|
+ const navigationBarHeight = systemInfo.statusBarHeight + 44;
|
|
|
const screenHeight = systemInfo.screenHeight
|
|
const screenHeight = systemInfo.screenHeight
|
|
|
|
|
|
|
|
const scale = '?x-oss-process=image/format,jpg/resize,w_400'
|
|
const scale = '?x-oss-process=image/format,jpg/resize,w_400'
|
|
@@ -65,7 +71,10 @@ export default function LogRecord({ route }) {
|
|
|
const [loading, setLoading] = useState(false)
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ let showActionSheetWithOptions;
|
|
|
|
|
+ if (process.env.TARO_ENV == 'rn') {
|
|
|
|
|
+ showActionSheetWithOptions = useActionSheet()
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
let router
|
|
let router
|
|
|
let navigation;
|
|
let navigation;
|
|
@@ -204,9 +213,12 @@ export default function LogRecord({ route }) {
|
|
|
|
|
|
|
|
function tapPic() {
|
|
function tapPic() {
|
|
|
//, t('health.delete')
|
|
//, t('health.delete')
|
|
|
|
|
+ var list = process.env.TARO_ENV == 'weapp' ? [t('health.add_photos'), t('health.camera2'), t('health.import_chat')] :
|
|
|
|
|
+ [t('health.add_photos'), t('health.camera2')]
|
|
|
showActionSheet({
|
|
showActionSheet({
|
|
|
title: '',
|
|
title: '',
|
|
|
- itemList: [t('health.add_photos'), t('health.camera2'), t('health.import_chat')],
|
|
|
|
|
|
|
+ showActionSheetWithOptions: showActionSheetWithOptions,
|
|
|
|
|
+ itemList: list,
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
switch (res) {
|
|
switch (res) {
|
|
|
case 0:
|
|
case 0:
|
|
@@ -237,10 +249,10 @@ export default function LogRecord({ route }) {
|
|
|
|
|
|
|
|
function addImage(isCamera) {
|
|
function addImage(isCamera) {
|
|
|
var source: any = isCamera ? ['camera'] : ['album']
|
|
var source: any = isCamera ? ['camera'] : ['album']
|
|
|
- Taro.chooseMedia({
|
|
|
|
|
|
|
+ Taro.chooseImage({
|
|
|
count: 9 - pics.length,
|
|
count: 9 - pics.length,
|
|
|
sizeType: ['compressed'],
|
|
sizeType: ['compressed'],
|
|
|
- mediaType: ['image'],
|
|
|
|
|
|
|
+ // mediaType: ['image'],
|
|
|
sourceType: source,
|
|
sourceType: source,
|
|
|
success: async function (res) {
|
|
success: async function (res) {
|
|
|
const results = await Promise.all(res.tempFiles.map(getImageInfo));
|
|
const results = await Promise.all(res.tempFiles.map(getImageInfo));
|
|
@@ -279,6 +291,7 @@ export default function LogRecord({ route }) {
|
|
|
const fileExt = dot > 0 ? path.substring(dot) : ''
|
|
const fileExt = dot > 0 ? path.substring(dot) : ''
|
|
|
Taro.request({
|
|
Taro.request({
|
|
|
method: 'GET',
|
|
method: 'GET',
|
|
|
|
|
+ timeout: 30000,
|
|
|
url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
|
|
url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
|
|
|
header: {
|
|
header: {
|
|
|
'Authorization': 'bearer ' + global.token
|
|
'Authorization': 'bearer ' + global.token
|
|
@@ -293,6 +306,7 @@ export default function LogRecord({ route }) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
Taro.uploadFile({
|
|
Taro.uploadFile({
|
|
|
|
|
+ timeout: 30000,
|
|
|
url: rsp.data.upload_url,
|
|
url: rsp.data.upload_url,
|
|
|
filePath: path,
|
|
filePath: path,
|
|
|
name: 'file',
|
|
name: 'file',
|
|
@@ -629,7 +643,7 @@ export default function LogRecord({ route }) {
|
|
|
</View>
|
|
</View>
|
|
|
<View style={{ height: navigationBarHeight }} />
|
|
<View style={{ height: navigationBarHeight }} />
|
|
|
{
|
|
{
|
|
|
- step == 0 && <ScrollView style={{ position: 'relative', zIndex: 1000, height: screenHeight - navigationBarHeight }} scrollY>
|
|
|
|
|
|
|
+ step == 0 && <ScrollView style={{ position: 'relative', zIndex: 1000, height: screenHeight - navigationBarHeight }} scrollY>
|
|
|
{/* <Snapshot id="temp"> */}
|
|
{/* <Snapshot id="temp"> */}
|
|
|
<View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(26) }}>
|
|
<View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(26) }}>
|
|
|
<Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
|
|
<Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
|
|
@@ -759,12 +773,12 @@ export default function LogRecord({ route }) {
|
|
|
setDesc(e.detail.value)
|
|
setDesc(e.detail.value)
|
|
|
}} />
|
|
}} />
|
|
|
<View className="form2">
|
|
<View className="form2">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
pics.map((item, index) => {
|
|
pics.map((item, index) => {
|
|
|
- return <View className="cover" key={index}>
|
|
|
|
|
- <Image src={item.url + scale} mode="aspectFill" className="cover" style={{
|
|
|
|
|
- margin: 0,
|
|
|
|
|
- }} key={index} onClick={() => {
|
|
|
|
|
|
|
+ return <View className="cover1" key={index}>
|
|
|
|
|
+ <Image src={item.url + scale} mode="aspectFill" className="cover2" key={index} onClick={() => {
|
|
|
Taro.previewImage({
|
|
Taro.previewImage({
|
|
|
current: pics[index].url,
|
|
current: pics[index].url,
|
|
|
urls: pics.map(file => file.url)
|
|
urls: pics.map(file => file.url)
|
|
@@ -795,7 +809,7 @@ export default function LogRecord({ route }) {
|
|
|
pics.length < 9 && <NewButton
|
|
pics.length < 9 && <NewButton
|
|
|
type={NewButtonType.custom}
|
|
type={NewButtonType.custom}
|
|
|
onClick={tapPic}>
|
|
onClick={tapPic}>
|
|
|
- <View className="cover" style={{}}><IconCamera color="#000" width={rpxToPx(48)} /></View>
|
|
|
|
|
|
|
+ <View className="cover1" style={{}}><IconCamera color="#000" width={rpxToPx(48)} /></View>
|
|
|
</NewButton>
|
|
</NewButton>
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
@@ -825,6 +839,9 @@ export default function LogRecord({ route }) {
|
|
|
|
|
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+ <View style={{width:300}}>
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
</ScrollView>
|
|
</ScrollView>
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|