Commit 59fc4c16 by yuzhenWang

合并薪资单,发布测试

parents e073acad eb7b9350
...@@ -120,4 +120,4 @@ ...@@ -120,4 +120,4 @@
<script type="module" src="/main.js"></script> <script type="module" src="/main.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="wapperBox"> <view class="wapperBox">
<view class="header"> <view class="header">
<text class="title">薪资<text class="highlight">单</text></text> <text class="title"><text class="highlight">积分</text></text>
<view class="year-badge" @click="showTime1=true"> <view class="year-badge" @click="showTime1=true">
<CommonTimePicker :timeData="startDate" :visible="showTime1" @confirmDate="changeStartTime" <CommonTimePicker :timeData="startDate" :visible="showTime1" @confirmDate="changeStartTime"
@closeTime="showTime1=false" :showMonth="false" iconColor="#2A36AE"/> @closeTime="showTime1=false" :showMonth="false" iconColor="#2A36AE"/>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<!-- <text class="label">{{ item.statusName }}</text> --> <!-- <text class="label">{{ item.statusName }}</text> -->
<view class="money" @click="showMoney(index)"> <view class="money" @click="showMoney(index)">
<text v-if="item.mask" class="mask-text">*****</text> <text v-if="item.mask" class="mask-text">*****</text>
<text v-else class="real-text">¥ {{ item.paidAmount.toFixed(2) }}</text> <text v-else class="real-text">{{ item.paidAmount.toFixed(2) }}(HKD)</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -44,31 +44,31 @@ ...@@ -44,31 +44,31 @@
<!-- <view style="border-top:2px solid #dce3ed; margin:0px 0;"></view> --> <!-- <view style="border-top:2px solid #dce3ed; margin:0px 0;"></view> -->
<view class="detail-grid"> <view class="detail-grid">
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.grossAmount">
<text class="label">应发金额</text> <text class="label">应发金额</text>
<text class="value">{{ item.detail.grossAmount.toFixed(2) }} (HKD)</text> <text class="value">{{ item.detail.grossAmount.toFixed(2) }} (HKD)</text>
</view> </view>
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.mpfAmount">
<text class="label">MPF事项金额</text> <text class="label">MPF事项金额</text>
<text class="value">{{ item.detail.mpfAmount.toFixed(2) }} (HKD)</text> <text class="value">{{ item.detail.mpfAmount.toFixed(2) }} (HKD)</text>
</view> </view>
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.otherAmount">
<text class="label">其他调整总金额</text> <text class="label">其他调整总金额</text>
<text class="value">{{ item.detail.otherAmount.toFixed(2) }} (HKD)</text> <text class="value">{{ item.detail.otherAmount.toFixed(2) }} (HKD)</text>
</view> </view>
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.paidAmount">
<text class="label">实发金额</text> <text class="label">实发金额</text>
<text class="value">{{ item.detail.paidAmount.toFixed(2) }}(HKD)</text> <text class="value">{{ item.detail.paidAmount.toFixed(2) }}(HKD)</text>
</view> </view>
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.remark">
<text class="label">备注</text> <text class="label">备注</text>
<text class="value txtValue">{{ item.detail.remark || '--'}}</text> <text class="value txtValue">{{ item.detail.remark || '--'}}</text>
</view> </view>
<view class="grid-row"> <view class="grid-row" v-if=" item.detail.otherRemark">
<text class="label">其他调整备注</text> <text class="label">其他调整备注</text>
<text class="value txtValue">{{ item.detail.otherRemark || '--' }}</text> <text class="value txtValue">{{ item.detail.otherRemark || '--' }}</text>
</view> </view>
<view class="grid-row" style="margin-bottom: 10rpx;"> <view class="grid-row" style="margin-bottom: 10rpx;" v-if=" item.detail.cancelRemark">
<text class="label">取消理由</text> <text class="label">取消理由</text>
<text class="value txtValue">{{ item.detail.cancelRemark || '--' }}</text> <text class="value txtValue">{{ item.detail.cancelRemark || '--' }}</text>
</view> </view>
...@@ -92,33 +92,36 @@ ...@@ -92,33 +92,36 @@
<view class="detail-grid" <view class="detail-grid"
v-for="(bank,index) in item.detail.apiSalaryRemittanceFzDTO.salaryRemittanceDTOList" v-for="(bank,index) in item.detail.apiSalaryRemittanceFzDTO.salaryRemittanceDTOList"
:key="bank.salaryRemittanceBizId"> :key="bank.salaryRemittanceBizId">
<view class="detail-title"> <view class="" v-if="bank.amount">
打款信息{{index+1}} <view class="detail-title">
</view> 打款信息{{index+1}}
<view class="grid-row"> </view>
<text class="label">收款银行</text> <view class="grid-row">
<text class="value txtValue">{{ bank.bankName}}</text> <text class="label">收款银行</text>
</view> <text class="value txtValue">{{ bank.bankName}}</text>
<view class="grid-row"> </view>
<text class="label">账户尾号</text> <view class="grid-row">
<text class="value">{{ bank.accountEndNo}}</text> <text class="label">账户尾号</text>
</view> <text class="value">{{ bank.accountEndNo}}</text>
<view class="grid-row"> </view>
<text class="label">发放金额</text> <view class="grid-row">
<text class="value">{{ bank.amount.toFixed(2) }} <text v-if="bank.currency">({{bank.currency}}) </text></text> <text class="label">发放金额</text>
</view> <text class="value">{{ bank.amount.toFixed(2) }} <text v-if="bank.currency">({{bank.currency}}) </text></text>
<view class="grid-row"> </view>
<text class="label">币种</text> <view class="grid-row">
<text class="value">{{ bank.currency}}</text> <text class="label">币种</text>
</view> <text class="value">{{ bank.currency}}</text>
<view class="grid-row"> </view>
<text class="label">汇率</text> <view class="grid-row">
<text class="value">{{ bank.exchangeRate.toFixed(4)}}</text> <text class="label">汇率</text>
</view> <text class="value">{{ bank.exchangeRate.toFixed(4)}}</text>
<view class="grid-row"> </view>
<text class="label">备注</text> <view class="grid-row" v-if="bank.remark">
<text class="value txtValue">{{ bank.remark || '--'}}</text> <text class="label">备注</text>
<text class="value txtValue">{{ bank.remark || '--'}}</text>
</view>
</view> </view>
</view> </view>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="banner" id="banner"> <view class="banner" id="banner">
<!--头部技术支持组件--> <!--头部技术支持组件-->
<!-- <commonHead></commonHead> --> <!-- <commonHead></commonHead> -->
<image src="../../static/images/banner.png" mode="widthFix"></image> <image src="../../static/images/banner.webp" mode="widthFix"></image>
</view> </view>
<scroll-view scroll-y="true" class="formInfoContainer" id="formInfoContainer" > <scroll-view scroll-y="true" class="formInfoContainer" id="formInfoContainer" >
<form> <form>
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
<view v-if="resultInfos.code == 'B001' || resultInfos.code =='B002'" style="display: flex;align-items: center;"> <view v-if="resultInfos.code == 'B001' || resultInfos.code =='B002'" style="display: flex;align-items: center;">
<!-- <view style="display: flex;align-items: center;"> --> <!-- <view style="display: flex;align-items: center;"> -->
<view style="margin-right: 16rpx;"> <view style="margin-right: 16rpx;">
<image src="../../static/images/happy.png" mode="widthFix"></image> <image src="../../static/images/happy.webp" mode="widthFix"></image>
</view> </view>
<view> <view>
<view>恭喜您!</view> <view>恭喜您!</view>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<view v-if="resultInfos.code == 'A001' || resultInfos.code =='A002'" style="display: flex;align-items: center;"> <view v-if="resultInfos.code == 'A001' || resultInfos.code =='A002'" style="display: flex;align-items: center;">
<!-- <view style="display: flex;align-items: center;"> --> <!-- <view style="display: flex;align-items: center;"> -->
<view style="margin-right: 16rpx;"> <view style="margin-right: 16rpx;">
<image src="../../static/images/sad.png" mode="widthFix"></image> <image src="../../static/images/sad.webp" mode="widthFix"></image>
</view> </view>
<view> <view>
<view>很遗憾!</view> <view>很遗憾!</view>
...@@ -226,8 +226,8 @@ ...@@ -226,8 +226,8 @@
</view> </view>
<view class="line" v-for="houseItem in housePurchasePrices"> <view class="line" v-for="houseItem in housePurchasePrices">
<view class="line_title">{{getResultTitle(houseItem.priceType)}} <view class="line_title">{{getResultTitle(houseItem.priceType)}}
<image src="../../static/images/can.png" v-show="houseItem.fvDifference <= 0" mode="widthFix"></image> <image src="../../static/images/can.webp" v-show="houseItem.fvDifference <= 0" mode="widthFix"></image>
<image src="../../static/images/cannot.png" v-show="houseItem.fvDifference > 0" mode="widthFix"></image> <image src="../../static/images/cannot.webp" v-show="houseItem.fvDifference > 0" mode="widthFix"></image>
</view> </view>
<view class="content"> <view class="content">
<view class="left"> <view class="left">
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
现值:{{numberConverter(houseItem.pvPriceRealization)}}元 现值:{{numberConverter(houseItem.pvPriceRealization)}}元
</view> --> </view> -->
</view> </view>
<image src="../../static/images/vs.png" mode="widthFix"></image> <image src="../../static/images/vs.webp" mode="widthFix"></image>
<view class="right"> <view class="right">
<view class="realizable">你想要的</view> <view class="realizable">你想要的</view>
<view>{{housePurchaseInfo.nyear}}年后:{{formatFloat(houseItem.fvPriceDesired/10000)}}万元</view> <view>{{housePurchaseInfo.nyear}}年后:{{formatFloat(houseItem.fvPriceDesired/10000)}}万元</view>
......
// var wx = require("weixin-js-sdk/index.js") //引入刚下载的js文件 // fiveshare.ts
// import $H from '@/api/request.js' //封装好的接口请求
// import wx from 'weixin-js-sdk'
import api from "../api/api"; import api from "../api/api";
import {companyInfo,baseURL,shareURL} from "@/environments/environment"; import { shareURL } from "@/environments/environment";
let userInfo = {name:''}
if(uni.getStorageSync('cffp_userInfo')){
userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
// 初始化SDK
export function initJssdkShare(callback, url) {
const WxConfigRequestVO = {
url: url,
systemType: uni.getStorageSync('addSystemType') || '1'
};
// 后端的自定义分享接口,拿到分享的appId、signature等信息
api.Wxshare(WxConfigRequestVO).then(res => {
jWeixin.config({
debug: false, // 生产环境关闭调试
appId: res.data.appId,
timestamp: res.data.timestamp,
nonceStr: res.data.nonceStr,
signature: res.data.signature,
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
});
jWeixin.ready(() => { let userInfo = { name: '' };
console.log('微信SDK初始化完成'); if (uni.getStorageSync('cffp_userInfo')) {
if (callback) callback(); userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'));
}); }
jWeixin.error(err => { // ===== 环境判断工具 =====
console.error('微信SDK初始化失败', err); function isWechatBrowser(): boolean {
}); return /micromessenger/i.test(navigator.userAgent);
});
} }
// 设置微信分享内容(不自动覆盖,需手动调用) function isMiniProgramWebView(): boolean {
export function setWechatShare(data) { // 检查微信环境变量
console.log('分享data',data); if (typeof window.__wxjs_environment !== 'undefined' && window.__wxjs_environment === 'miniprogram') {
if (!jWeixin) { return true;
console.error('微信SDK未初始化'); }
return; // 检查 URL 参数
} if (window.location.search.indexOf('from=miniprogram') > -1 ||
if(!data){ window.location.hash.indexOf('from=miniprogram') > -1) {
const currentUrl = `${shareURL}/pages/index/index`; return true;
data = { }
title: '成为银盾合伙人,分享商品赚不停', return false;
// desc: `${userInfo.name || ''}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`, }
desc: `资源+伙伴,共赢未来!`,
link: currentUrl, // ===== 确保微信 SDK 已加载 =====
imgUrl: `${shareURL}/static/images/shareBg.png` function ensureWechatSDK(): Promise<void> {
}; return new Promise((resolve, reject) => {
} // 如果已经有 jWeixin 且不是占位对象
jWeixin.ready(() => { // @ts-ignore
// 新API(推荐) if (window.jWeixin && window.jWeixin.config !== function() { console.warn('[占位] wx.config'); }) {
jWeixin.updateAppMessageShareData({ resolve();
title: data.title, return;
desc: data.desc, }
link: data.link,
imgUrl: data.imgUrl, // 如果已经有 wx(原生对象)
success: () => console.log('好友分享设置成功') // @ts-ignore
}); if (typeof wx !== 'undefined' && wx.config) {
// @ts-ignore
jWeixin.updateTimelineShareData({ window.jWeixin = wx;
title: data.title, resolve();
link: data.link, return;
imgUrl: data.imgUrl, }
success: () => console.log('朋友圈分享设置成功')
// 动态加载微信 SDK
const script = document.createElement('script');
script.src = 'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js';
script.onload = function() {
// @ts-ignore
if (typeof wx !== 'undefined') {
// @ts-ignore
window.jWeixin = wx;
console.log('✅ 微信 SDK 动态加载成功');
resolve();
} else {
reject(new Error('微信 SDK 加载失败'));
}
};
script.onerror = function() {
reject(new Error('微信 SDK CDN 加载失败'));
};
document.head.appendChild(script);
}); });
}
// ===== 初始化微信 SDK =====
export function initJssdkShare(callback: any, url: string) {
// 只在微信浏览器且非小程序环境中初始化
if (!isWechatBrowser() || isMiniProgramWebView()) {
console.log('当前环境不需要初始化微信 SDK:',
isWechatBrowser() ? '微信浏览器' : '非微信浏览器',
isMiniProgramWebView() ? '小程序 WebView' : '普通环境'
);
if (callback) callback();
return;
}
console.log('🔄 开始初始化微信 SDK...');
// 旧API(兼容) ensureWechatSDK().then(() => {
jWeixin.onMenuShareAppMessage({ // @ts-ignore
title: data.title, const wx = window.jWeixin || window.wx;
desc: data.desc, if (!wx) {
link: data.link, console.error('❌ 无法获取微信 SDK');
imgUrl: data.imgUrl, if (callback) callback();
success: () => console.log('旧版分享设置成功') return;
}
const WxConfigRequestVO = {
url: url || window.location.href.split('#')[0],
systemType: uni.getStorageSync('addSystemType') || '1'
};
api.Wxshare(WxConfigRequestVO).then(res => {
wx.config({
debug: false,
appId: res.data.appId,
timestamp: res.data.timestamp,
nonceStr: res.data.nonceStr,
signature: res.data.signature,
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
});
wx.ready(() => {
console.log('✅ 微信 SDK 初始化完成');
if (callback) callback();
});
wx.error((err: any) => {
console.error('❌ 微信 SDK 初始化失败', err);
if (callback) callback();
});
}).catch(err => {
console.error('❌ 获取微信签名失败', err);
if (callback) callback();
});
}).catch(err => {
console.error('❌ 微信 SDK 加载失败', err);
if (callback) callback();
}); });
});
} }
// 在页面上直接调用此方法实现h5的自定义分享 data是穿的参数 url是当前页面的链接
export function hshare(data,url){ // ===== 获取分享数据 =====
console.log('data,url',data,url); function getShareData(data?: any) {
// 确保分享的链接不包含时间戳 if (data) return data;
// initJssdkShare(data, url)
initJssdkShare(function(){
jWeixin.ready(function(){
var sharedata={
title: data.title, //标题
desc: data.desc, //描述
link: data.link ,//分享链接
imgUrl:data.imgUrl, //图片
success:(res=>{
})
};
jWeixin.updateAppMessageShareData(sharedata)//自定义微信分享给朋友
jWeixin.updateTimelineShareData(sharedata);//自定义微信分享给朋友
jWeixin.onMenuShareAppMessage(sharedata);//获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
})
},url)
}
// 新的分享方法 直接调起微信好友弹窗
// 设置微信分享内容并直接调起分享
export function setWechatShareDirectly(data) {
if (!jWeixin) {
console.error('微信SDK未初始化');
return;
}
if(!data){
const currentUrl = `${shareURL}/pages/index/index`; const currentUrl = `${shareURL}/pages/index/index`;
data = { return {
title: '成为银盾合伙人,分享商品赚不停', title: '成为银盾合伙人,分享商品赚不停',
desc: `资源+伙伴,共赢未来!`, desc: '资源+伙伴,共赢未来!',
link: currentUrl, link: currentUrl,
imgUrl: `${shareURL}/static/images/shareBg.png` imgUrl: `${shareURL}/static/images/shareBg.png`
}; };
} }
jWeixin.ready(() => { // ===== 设置微信分享(主入口) =====
// 尝试直接调起分享 export function setWechatShare(data: any) {
console.log('📤 setWechatShare 被调用', data);
// 在小程序环境中,不执行微信分享
if (isMiniProgramWebView()) {
console.log('📱 小程序环境,跳过微信分享设置');
return;
}
// 在微信浏览器中执行
if (isWechatBrowser()) {
const shareData = getShareData(data);
// 确保 SDK 已加载
ensureWechatSDK().then(() => {
// @ts-ignore
const wx = window.jWeixin || window.wx;
if (!wx) {
console.error('❌ 微信 SDK 不可用');
return;
}
wx.ready(() => {
wx.updateAppMessageShareData({
title: shareData.title,
desc: shareData.desc,
link: shareData.link,
imgUrl: shareData.imgUrl,
success: () => console.log('✅ 好友分享设置成功'),
fail: (err: any) => console.error('❌ 好友分享设置失败', err)
});
wx.updateTimelineShareData({
title: shareData.title,
link: shareData.link,
imgUrl: shareData.imgUrl,
success: () => console.log('✅ 朋友圈分享设置成功'),
fail: (err: any) => console.error('❌ 朋友圈分享设置失败', err)
});
wx.onMenuShareAppMessage({
title: shareData.title,
desc: shareData.desc,
link: shareData.link,
imgUrl: shareData.imgUrl,
success: () => console.log('✅ 旧版分享设置成功')
});
});
}).catch(err => {
console.error('❌ SDK 加载失败,无法设置分享', err);
});
} else {
console.log('🌐 非微信环境,跳过微信分享设置');
}
}
// ===== hshare 主入口 =====
export function hshare(data: any, url: string) {
console.log('📤 hshare 被调用', data, url);
// 如果在非微信浏览器中,提示用户复制链接
if (!isWechatBrowser() || isMiniProgramWebView()) {
const shareData = getShareData(data);
// 降级方案:复制链接
fallbackShare(shareData);
return;
}
// 微信浏览器中执行分享
initJssdkShare(() => {
setWechatShare(data);
}, url);
}
// ===== 降级方案 =====
function fallbackShare(data: any) {
console.log('📋 降级方案:复制链接', data.link);
try { try {
// 注意:此接口需要特定权限,普通公众号可能无法使用 // @ts-ignore
jWeixin.invoke('shareWechatMessage', { if (typeof uni !== 'undefined' && uni.setClipboardData) {
title: data.title, // @ts-ignore
desc: data.desc, uni.setClipboardData({
link: data.link, data: data.link,
imgUrl: data.imgUrl success: () => {
}, function(res) { // @ts-ignore
if(res.err_msg === 'shareWechatMessage:ok') { uni.showToast({
console.log('分享成功'); title: '链接已复制,请分享给好友',
icon: 'none'
});
}
});
} else if (navigator.clipboard) {
navigator.clipboard.writeText(data.link).then(() => {
alert('链接已复制,请分享给好友');
}).catch(() => {
alert('请复制链接: ' + data.link);
});
} else { } else {
// fallback 到常规分享设置 alert('请复制链接: ' + data.link);
setWechatShare(data);
} }
});
} catch (e) { } catch (e) {
console.error('直接调起分享失败,使用常规分享', e); alert('请复制链接: ' + data.link);
// 常规分享设置
jWeixin.updateAppMessageShareData({
title: data.title,
desc: data.desc,
link: data.link,
imgUrl: data.imgUrl,
success: () => console.log('好友分享设置成功')
});
} }
}); }
// ===== 兼容旧方法 =====
export function setWechatShareDirectly(data: any) {
hshare(data, window.location.href);
} }
\ No newline at end of file
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