| | |
| | | private static BufferedImage getImgIO(InputStream is) { |
| | | if(is ==null){ |
| | | log.error("=============================qrcode error 小程序码为空"); |
| | | }else{ |
| | | |
| | | log.error("=============================qrcode okay 小程序码有有數據"); |
| | | } |
| | | try { |
| | | return ImageIO.read(is); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static InputStream generateShareImg(String imgurl, InputStream mpCode, String title) { |
| | | public static InputStream generateShareImg(String imgurl, InputStream mpCode1, String title) { |
| | | |
| | | BufferedImage bi = new BufferedImage(750, 976, BufferedImage.TYPE_INT_RGB); |
| | | //得到它的绘制环境(这张图片的笔) |
| | |
| | | g2.drawString("查看更多精彩内容", 40,820+th); |
| | | |
| | | |
| | | BufferedImage img3 = getImgIO(mpCode); |
| | | BufferedImage img3 = getImgIO(mpCode1); |
| | | if(img3!=null){ |
| | | g2.setColor(Color.white); |
| | | g2.drawImage(img3, 530, 736, 180, 180, null); |
| | | } |
| | | InputStream inputStream = bufferedImageToInputStream(bi); |
| | |
| | | g2.drawImage(setRadius(img1,img1.getWidth(),0,0), (int)(20*rate), (int)(h-68*rate), (int)(48*rate) ,(int)(48*rate), null); |
| | | } |
| | | |
| | | Font font =new Font("黑体", Font.PLAIN, (int)(28 * rate)); |
| | | FontMetrics fontMetrics = g2.getFontMetrics(font); |
| | | int textWidth = fontMetrics.stringWidth(name); |
| | | |
| | | g2.setColor(Color.white); |
| | | g2.setFont(new Font("黑体", Font.PLAIN, (int)(28 * rate))); |
| | | g2.drawString(name, (int) (80*rate),h-(int)((64-th)*rate)); |
| | | Font font =new Font("黑体", Font.PLAIN, (int)(24 * rate)); |
| | | g2.setColor(Color.white); |
| | | g2.setFont(font); |
| | | g2.drawString(name, (int) (80*rate),h-(int)((64-th)*rate)); |
| | | g2.setColor(Color.white); |
| | | g2.setFont(new Font("黑体", Font.PLAIN, (int)(24* rate))); |
| | | g2.drawString("扫描看更多", (int)(w -(textWidth+30*rate)),h-(int)(rate*(50-th))); |
| | | FontMetrics fontMetrics = g2.getFontMetrics(font); |
| | | int textWidth = fontMetrics.stringWidth("扫码看更多"); |
| | | g2.drawString("扫码看更多", (int)(w -(textWidth+20*rate)),h-(int)(rate*(50-th))); |
| | | |
| | | BufferedImage img3 = getImgIO(mpCode); |
| | | if(img3!=null){ |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.interfaces.MPJBaseJoin; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.Response; |
| | | import org.apache.catalina.User; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | * @date 2024/07/04 14:40 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class UsersServiceImpl implements UsersService { |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public String getContentShareImg(Users users, ContentShareImgDto param){ |
| | | log.error("======================start===========:海报开始"+JSONObject.toJSONString(param)); |
| | | users = usersMapper.selectById(users.getId()); |
| | | this.getUsersDetail(users); |
| | | if(StringUtils.isBlank(param.getImgurl())){ |
| | |
| | | |
| | | private String dealShareImgNoUser(ContentShareImgDto param, Users users, String shareFolder, String path) { |
| | | String url =null; |
| | | //内容分享海报图片 |
| | | //内容分享海报图片 |
| | | log.error("======================start===========:海报开始"); |
| | | InputStream mpCode = Constants.generateWxMiniImgStream(systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG, Constants.WX_TOKEN_CUSTOMER).getCode(), |
| | | //"userId="+users.getId()+"&articleId="+param.getArticleId(), |
| | | param.getArticleId()+"_"+users.getId(), |
| | | param.getPageUrl());//小程序 |
| | | |
| | | log.error("======================mpcode===========:获取小程序码开始"); |
| | | String title = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.SHARE_HAIBAO_HEADER_TITLE).getCode(); |
| | | InputStream inputStream = GeneratePicUtil.generateShareImg( |
| | | param.getImgurl() |
| | | ,mpCode |
| | | ,title); |
| | | |
| | | log.error("======================huatu===========:画图结束"); |
| | | TyyZosUtil obs = new TyyZosUtil( systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ENDPOINT).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ACCESS_ID).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ACCESS_KEY).getCode()); |
| | |
| | | margin-bottom: 26rpx; |
| | | } |
| | | .main_content .text { |
| | | line-height: 36rpx; |
| | | font-size: 26rpx; |
| | | color: #555555; |
| | | margin-bottom: 40rpx; |
| | |
| | | itemClick(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | if(item.contentType == 'video'){ |
| | | wx.previewMedia({ |
| | | sources: [{ url: item.content, type: 'video' }] |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | if(item.contentType == 'link'){ |
| | | wx.navigateTo({ |
| | |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | res.eventChannel.emit('data',{link:item.content} ); |
| | | } |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | if(item.contentType == 'page'){ |
| | | getApp().globalData.catalogCode=item.content |
| | | wx.switchTab({ |
| | | url: '/pages/discover/discover' |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | }, |
| | | cateClick(e) { |
| | |
| | | export const baseUrl = 'http://192.168.0.135:10027' |
| | | export const baseUrl = 'http://192.168.0.107:10027' |
| | | // export const baseUrl = 'https://dmtest.ahapp.net/web_interface' // 本地 |
| | | // export const baseUrl = 'http://zbtest.ahapp.net/zbom_interface/jx/wechat/' //测试服务器 |
| | | |