Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-08-05 17:24:40 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
fbfac017f255fdf138983fbb2d665bd33ca6518e
fbfac017
2 parents
1b81eb46
5dde410e
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
20 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/utils/CameraPickerUtils.ets
sight_harmony/features/wdComponent/src/main/ets/utils/PhotoPickerUtils.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
fbfac01
...
...
@@ -117,7 +117,8 @@ export struct ImageAndTextPageComponent {
if (this.likeNum > 0) {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
//.fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
.fontColor((this.likeNumTextColor()))
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.margin({ left: 5 })
...
...
@@ -267,6 +268,14 @@ export struct ImageAndTextPageComponent {
.backgroundColor(Color.White)
}
private likeNumTextColor() {
if(this.newsStatusOfUser?.likeStatus == '1'){
//已点赞状态 祈福和默哀为黑色 其余为红色
return (this.contentDetailData?.likesStyle == 2 || this.contentDetailData?.likesStyle == 3) ? '#222222' : '#ED2800'
}
return '#999999'
}
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
if (!this.isNetConnected) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
fbfac01
...
...
@@ -242,7 +242,7 @@ export struct MorningEveningPaperComponent {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.get
MainColorSync
();
let color = colorPicker.get
LargestProportionColor
();
console.log(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
fbfac01
...
...
@@ -200,12 +200,13 @@ export struct AppointmentListUI {
let time = arr[0].split("-");
if (time.length === 3) {
let month = time[1].indexOf("0") === 0 ? time[1].substring(1) : time[1]
let day = time[2]
// let day = time[2]
let day = time[2].indexOf("0") === 0 ? time[2].substring(1) : time[2]
dealData[0] = `${month}月${day}日`
let today = `${new Date().getMonth() + 1}月${new Date().getDate()}日`
if (dealData[0] === today) {
dealData[0] = "今
日
"
dealData[0] = "今
天
"
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
fbfac01
...
...
@@ -15,6 +15,7 @@ import { TrackConstants } from 'wdTracking/Index';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { photoPickerUtils} from '../../utils/PhotoPickerUtils';
import { cameraPickerUtils } from '../../utils/CameraPickerUtils';
@Entry
@Component
...
...
@@ -104,7 +105,7 @@ struct EditUserInfoPage {
}
})
}else {
photo
PickerUtils.getCamera().then(value => {
camera
PickerUtils.getCamera().then(value => {
if (value.length > 0) {
this.headerImg = value
}
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/CameraPickerUtils.ets
0 → 100644
View file @
fbfac01
import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit';
import { camera, cameraPicker as picker } from '@kit.CameraKit';
let mContext = getContext(this) as common.Context;
const PERMISSIONS: Array<Permissions> = [
'ohos.permission.READ_IMAGEVIDEO',
];
export class CameraPickerUtils {
async getCamera(){
this.pickerPermissions()
let pickerProfile: picker.PickerProfile = {
cameraPosition: camera.CameraPosition.CAMERA_POSITION_BACK
};
let pickerResult: picker.PickerResult = await picker.pick(mContext,
[picker.PickerMediaType.PHOTO], pickerProfile);
return new Promise<string>((success, fail) => {
if (pickerResult['resultCode'] === 0) {
success(pickerResult['resultUri'])
}
})
}
async pickerPermissions(){
///权限查询
const context = getContext(this) as common.UIAbilityContext;
const atManager = abilityAccessCtrl.createAtManager();
await atManager.requestPermissionsFromUser(context, PERMISSIONS);
}
}
export const cameraPickerUtils: CameraPickerUtils = new CameraPickerUtils();
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/PhotoPickerUtils.ets
View file @
fbfac01
...
...
@@ -30,21 +30,21 @@ export class PhotoPickerUtils {
})
}
async getCamera(){
this.pickerPermissions()
let pickerProfile: cameraPicker.PickerProfile = {
cameraPosition: camera.CameraPosition.CAMERA_POSITION_BACK
};
let pickerResult: cameraPicker.PickerResult = await cameraPicker.pick(mContext,
[cameraPicker.PickerMediaType.PHOTO, cameraPicker.PickerMediaType.VIDEO], pickerProfile);
return new Promise<string>((success, fail) => {
if (pickerResult['resultCode'] === 0) {
success(pickerResult['resultUri'])
}
})
}
// async getCamera(){
// this.pickerPermissions()
//
// let pickerProfile: cameraPicker.PickerProfile = {
// cameraPosition: camera.CameraPosition.CAMERA_POSITION_BACK
// };
// let pickerResult: cameraPicker.PickerResult = await cameraPicker.pick(mContext,
// [cameraPicker.PickerMediaType.PHOTO, cameraPicker.PickerMediaType.VIDEO], pickerProfile);
//
// return new Promise<string>((success, fail) => {
// if (pickerResult['resultCode'] === 0) {
// success(pickerResult['resultUri'])
// }
// })
// }
async pickerPermissions(){
///权限查询
...
...
Please
register
or
login
to post a comment