rules.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="intro-page common">
  3. <view class="top-class"></view>
  4. <view class="title">
  5. 活动规则
  6. </view>
  7. <view class="head">
  8. <u-row class="row-class">
  9. <u-col span="4">
  10. <image class="logo-img" src="/static/images/common/logo.png" mode="aspectFit" />
  11. </u-col>
  12. <u-col span="4">
  13. <image class="commodity-img" src="/static/images/common/commodity.png" mode="aspectFit" />
  14. </u-col>
  15. <u-col span="4">
  16. </u-col>
  17. </u-row>
  18. </view>
  19. <view class="theme-text">
  20. <image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/text.png"
  21. class="textImage"></image>
  22. </view>
  23. <!-- 公司简介内容卡片 -->
  24. <view class="intro-card">
  25. <view class="intro-view">
  26. <view class="intro-label">
  27. <view class="label-title">
  28. 规则信息
  29. </view>
  30. </view>
  31. <view class="intro-content">
  32. <view class="rule-text">
  33. 凡购买我司产品,扫描外包装背后二维码,即有机会参与优惠活动,赢取优惠或实物礼品。凡购买我司产品,扫描外包装背后二维码,即有机会参与优惠活动,赢取优惠或实物礼品。凡购买我司产品,扫描外包装背后二维码,即有机会参与优惠活动,赢取优惠或实物礼品.
  34. </view>
  35. </view>
  36. </view>
  37. <view class="intro-view">
  38. <view class="intro-label" style="right: 20px;">
  39. <view class="label-title">
  40. 活动奖励
  41. </view>
  42. </view>
  43. <view class="intro-content">
  44. <u-row class="row-class" customStyle="margin-bottom: 5px" v-for="(item, index) in planDetails">
  45. <u-col span="12">
  46. <view class="item-left item-text">{{item.prize_name}}</view>
  47. </u-col>
  48. </u-row>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 返回按钮 -->
  53. <view class="footer-btn">
  54. <view @click="goBack" class="return-button">返回</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. getRule
  61. } from '@/api/scan'
  62. export default {
  63. data() {
  64. return {
  65. scanCode:'',
  66. planDetails:[]
  67. }
  68. },
  69. onLoad() {
  70. this.scanCode = uni.getStorageSync('scanCode');
  71. this.initRuleData();
  72. },
  73. methods: {
  74. goBack() {
  75. uni.navigateBack();
  76. },
  77. initRuleData(){
  78. getRule(this.scanCode).then(res => {
  79. console.log(res)
  80. if (res.code == 0) {
  81. this.planDetails = res.data.planDetails;
  82. }
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. @import url('../../../static/scss/common.css');
  90. .row-class {
  91. height: 80rpx;
  92. }
  93. .logo-img {
  94. background-size: cover;
  95. /* 确保背景图片自适应填充整个容器 */
  96. background-position: center;
  97. /* 背景图片居中显示 */
  98. background-repeat: no-repeat;
  99. /* 防止背景图重复 */
  100. height: 42rpx;
  101. width: 62%;
  102. }
  103. .commodity-img {
  104. background-size: cover;
  105. /* 确保背景图片自适应填充整个容器 */
  106. background-position: center;
  107. /* 背景图片居中显示 */
  108. background-repeat: no-repeat;
  109. /* 防止背景图重复 */
  110. height: 35rpx;
  111. width: 100%;
  112. }
  113. .theme-text {
  114. height: 10vh;
  115. text-align: center;
  116. line-height: 11vh;
  117. .textImage {
  118. height: 80rpx;
  119. width: 400rpx;
  120. }
  121. }
  122. .intro-card {
  123. margin: 0 32rpx;
  124. background: rgba(131, 100, 71, 0.5);
  125. border-radius: 10rpx;
  126. height: 65vh;
  127. .intro-view {
  128. border: 2rpx solid #341B10;
  129. padding: 20rpx;
  130. margin: 20rpx;
  131. position: relative;
  132. margin-bottom: 60rpx;
  133. .intro-label {
  134. background-image:
  135. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
  136. /* 使用绝对路径 */
  137. background-size: contain;
  138. background-repeat: no-repeat;
  139. width: 220rpx;
  140. height: 120rpx;
  141. position: absolute;
  142. margin-top: -70rpx;
  143. align-content: center;
  144. margin-left: -28rpx;
  145. .label-title {
  146. font-weight: bold;
  147. font-size: 30rpx;
  148. color: #341B10;
  149. text-align: center;
  150. margin-left: 10px;
  151. height: 120rpx;
  152. line-height: 110rpx;
  153. }
  154. }
  155. .intro-content {
  156. padding-top: 20rpx;
  157. font-size: 28rpx;
  158. color: #5c4322;
  159. line-height: 1.8;
  160. margin-top: 20rpx;
  161. text-align: justify;
  162. }
  163. }
  164. }
  165. .image-display{
  166. text-align: center;
  167. .company-img {
  168. width: 80%;
  169. height: 240rpx;
  170. border-radius: 12rpx;
  171. object-fit: cover;
  172. margin-top: 10rpx;
  173. background: #eee;
  174. }
  175. }
  176. .item-text{
  177. font-weight: 500;
  178. font-size: 30rpx;
  179. color: #FFFFFF;
  180. }
  181. .rule-text{
  182. font-weight: 500;
  183. font-size: 24rpx;
  184. color: #FFFFFF;
  185. }
  186. ::v-deep .item-left{
  187. background: #442812;
  188. border-radius: 6rpx !important;
  189. text-align: center;
  190. width: 80%;
  191. }
  192. </style>