百富门答题小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
2.4 KiB

2 weeks ago
1 week ago
2 weeks ago
1 week ago
2 weeks ago
  1. <template>
  2. <view class="page">
  3. <image :src="configList.img_13"
  4. class="page-bg"
  5. mode="aspectFill"></image>
  6. <image :src="configList.img_7"
  7. class="logo"
  8. mode="widthFix"></image>
  9. <!-- next1 -->
  10. <view class="content">
  11. <image :src="titleBy.image"
  12. class="content-bg"
  13. mode="widthFix"></image>
  14. </view>
  15. <view class="btn-list">
  16. <view class="next-btn-2"
  17. @click="save">
  18. 保存
  19. </view>
  20. <view class="next-btn"
  21. @click="next">
  22. 下一页
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { mapState } from 'vuex'
  29. export default {
  30. data() {
  31. return {
  32. index : 0,
  33. }
  34. },
  35. computed : {
  36. ...mapState(['titleBy', 'configList']),
  37. },
  38. onLoad() {
  39. console.log(this.$store.state.titleBy.image);
  40. },
  41. onShow() {
  42. },
  43. methods: {
  44. next(){
  45. uni.navigateTo({
  46. url: '/pages/index/article'
  47. })
  48. },
  49. async save(){
  50. await this.$authorize('scope.writePhotosAlbum')
  51. uni.getImageInfo({
  52. src: this.titleBy.image,
  53. success: function(image) {
  54. /* 保存图片到手机相册 */
  55. uni.saveImageToPhotosAlbum({
  56. filePath: image.path,
  57. success: function() {
  58. uni.showModal({
  59. title: '保存成功',
  60. content: '图片已成功保存到相册',
  61. showCancel: false
  62. });
  63. },
  64. complete(res) {
  65. console.log(res);
  66. }
  67. });
  68. }
  69. });
  70. },
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .page{
  76. .logo{
  77. width: 600rpx;
  78. margin: 150rpx 75rpx;
  79. margin-bottom: 0;
  80. }
  81. .content{
  82. position: relative;
  83. display: flex;
  84. flex-direction: column;
  85. align-items: center;
  86. justify-content: center;
  87. box-sizing: border-box;
  88. text-align: center;
  89. width: 750rpx;
  90. margin: 0 auto;
  91. margin-bottom: 50rpx;
  92. z-index: 999;
  93. .content-bg{
  94. width: 100%;
  95. top: 0;
  96. left: 0;
  97. }
  98. }
  99. }
  100. .btn-list{
  101. display: flex;
  102. flex-direction: column;
  103. gap: 40rpx;
  104. width: 100%;
  105. justify-content: center;
  106. align-items: center;
  107. }
  108. .next-btn{
  109. width: 400rpx;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. color: white;
  114. padding: 16rpx 90rpx;
  115. background-color: $uni-color;
  116. border-radius: 30rpx;
  117. }
  118. .next-btn-2{
  119. width: 400rpx;
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. color: white;
  124. padding: 16rpx 90rpx;
  125. background-color: $uni-color-primary;
  126. border-radius: 30rpx;
  127. }
  128. .second-color{
  129. margin-top: 20rpx;
  130. }
  131. </style>