shareJson.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. const getwxml = ( qrcodeUrl, name = '这是一件文物', wenwuUrl ) => {
  2. const wxml = `<view class="container">
  3. <view class="top-image">
  4. <image class="wenwubg" src="${wenwuUrl}"></image>
  5. </view>
  6. <view class="item-box">
  7. <image class="btmbg" src="https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/img_share_bg.png"></image>
  8. <view class="left-box">
  9. <text class="text scrwenwu">${name}</text>
  10. <text class="text scrcontent">长按扫码 查看更多内容</text>
  11. </view>
  12. <view class="right-box">
  13. <image class="qrcode" src="${qrcodeUrl}"></image>
  14. </view>
  15. </view>
  16. </view>
  17. `
  18. return wxml
  19. }
  20. const style = {
  21. container: {
  22. width: 360,
  23. height: 256,
  24. flexDirection: 'column',
  25. backgroundColor: '#262626',
  26. alignItems: 'center',
  27. justifyContent: 'center',
  28. },
  29. topImage: {
  30. width: 280,
  31. height: 190,
  32. },
  33. wenwubg: {
  34. width: 280,
  35. height: 190,
  36. },
  37. itemBox: {
  38. position: 'relative',
  39. width: 360,
  40. height: 66,
  41. },
  42. btmbg: {
  43. width: 360,
  44. height: 66,
  45. },
  46. leftBox: {
  47. position:'absolute',
  48. left: 0,
  49. top: 0,
  50. width: 177,
  51. height: 66,
  52. flexDirection: 'column',
  53. justifyContent: 'center',
  54. alignItems: 'center',
  55. paddingLeft: 24,
  56. marginTop: 4,
  57. },
  58. text: {
  59. width: 177,
  60. height: 30,
  61. textAlign: 'left',
  62. },
  63. scrwenwu: {
  64. fontSize: 14,
  65. color: '#383127',
  66. verticalAlign: 'bottom',
  67. },
  68. scrcontent: {
  69. fontSize: 10,
  70. color: '#B39775',
  71. verticalAlign: 'top',
  72. },
  73. rightBox: {
  74. width: 60,
  75. height: 50,
  76. position:'absolute',
  77. right: 0,
  78. top: 8,
  79. },
  80. qrcode: {
  81. width: 50,
  82. height: 50,
  83. borderRadius: 1,
  84. }
  85. }
  86. module.exports = {
  87. getwxml,
  88. style
  89. }