shareJson.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. const getwxml = ( qrcodeUrl, name = '这是一件文物', wenwuUrl ) => {
  2. const wxml = `<view class="container">
  3. <view class="top-image">
  4. <image class="wenwubg" src="https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/test.png"></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: '#ccc',
  26. alignItems: 'center',
  27. },
  28. topImage: {
  29. width: 360,
  30. height: 190,
  31. },
  32. wenwubg: {
  33. width: 360,
  34. height: 190,
  35. },
  36. itemBox: {
  37. position: 'relative',
  38. width: 360,
  39. height: 66,
  40. },
  41. btmbg: {
  42. width: 360,
  43. height: 66,
  44. },
  45. leftBox: {
  46. position:'absolute',
  47. left: 0,
  48. top: 0,
  49. width: 177,
  50. height: 66,
  51. flexDirection: 'column',
  52. justifyContent: 'center',
  53. alignItems: 'center',
  54. paddingLeft: 24,
  55. marginTop: 4,
  56. },
  57. text: {
  58. width: 177,
  59. height: 30,
  60. textAlign: 'left',
  61. },
  62. scrwenwu: {
  63. fontSize: 14,
  64. color: '#383127',
  65. verticalAlign: 'bottom',
  66. },
  67. scrcontent: {
  68. fontSize: 10,
  69. color: '#B39775',
  70. verticalAlign: 'top',
  71. },
  72. rightBox: {
  73. width: 60,
  74. height: 50,
  75. position:'absolute',
  76. right: 0,
  77. top: 8,
  78. },
  79. qrcode: {
  80. width: 50,
  81. height: 50,
  82. borderRadius: 1,
  83. }
  84. }
  85. module.exports = {
  86. getwxml,
  87. style
  88. }