rules.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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="4">
  46. <view class="item-left item-text">{{item.prize_name}}</view>
  47. </u-col>
  48. <u-col span="8">
  49. <view class="item-text">{{item.prize_desc}}</view>
  50. </u-col>
  51. </u-row>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 返回按钮 -->
  56. <view class="footer-btn">
  57. <view @click="goBack" class="return-button">返回</view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. getRule
  64. } from '@/api/scan'
  65. export default {
  66. data() {
  67. return {
  68. scanCode:'',
  69. planDetails:[]
  70. }
  71. },
  72. onLoad() {
  73. this.scanCode = uni.getStorageSync('scanCode');
  74. this.initRuleData();
  75. },
  76. methods: {
  77. goBack() {
  78. uni.navigateBack();
  79. },
  80. initRuleData(){
  81. getRule(this.scanCode).then(res => {
  82. console.log(res)
  83. if (res.code == 0) {
  84. this.planDetails = res.data.planDetails;
  85. }
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. @import url('../../../static/scss/common.css');
  93. .row-class {
  94. height: 80rpx;
  95. }
  96. .logo-img {
  97. background-size: cover;
  98. /* 确保背景图片自适应填充整个容器 */
  99. background-position: center;
  100. /* 背景图片居中显示 */
  101. background-repeat: no-repeat;
  102. /* 防止背景图重复 */
  103. height: 42rpx;
  104. width: 62%;
  105. }
  106. .commodity-img {
  107. background-size: cover;
  108. /* 确保背景图片自适应填充整个容器 */
  109. background-position: center;
  110. /* 背景图片居中显示 */
  111. background-repeat: no-repeat;
  112. /* 防止背景图重复 */
  113. height: 35rpx;
  114. width: 100%;
  115. }
  116. .theme-text {
  117. height: 10vh;
  118. text-align: center;
  119. line-height: 11vh;
  120. .textImage {
  121. height: 80rpx;
  122. width: 400rpx;
  123. }
  124. }
  125. .intro-card {
  126. margin: 0 32rpx;
  127. background: rgba(131, 100, 71, 0.5);
  128. border-radius: 10rpx;
  129. height: 65vh;
  130. .intro-view {
  131. border: 2rpx solid #341B10;
  132. padding: 20rpx;
  133. margin: 20rpx;
  134. position: relative;
  135. margin-bottom: 60rpx;
  136. .intro-label {
  137. background-image:
  138. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
  139. /* 使用绝对路径 */
  140. background-size: contain;
  141. background-repeat: no-repeat;
  142. width: 220rpx;
  143. height: 120rpx;
  144. position: absolute;
  145. margin-top: -70rpx;
  146. align-content: center;
  147. margin-left: -28rpx;
  148. .label-title {
  149. font-weight: bold;
  150. font-size: 30rpx;
  151. color: #341B10;
  152. text-align: center;
  153. margin-left: 10px;
  154. height: 120rpx;
  155. line-height: 110rpx;
  156. }
  157. }
  158. .intro-content {
  159. font-size: 28rpx;
  160. color: #5c4322;
  161. line-height: 1.8;
  162. margin-top: 20rpx;
  163. text-align: justify;
  164. }
  165. }
  166. }
  167. .image-display{
  168. text-align: center;
  169. .company-img {
  170. width: 80%;
  171. height: 240rpx;
  172. border-radius: 12rpx;
  173. object-fit: cover;
  174. margin-top: 10rpx;
  175. background: #eee;
  176. }
  177. }
  178. .item-text{
  179. font-weight: 500;
  180. font-size: 30rpx;
  181. color: #FFFFFF;
  182. }
  183. .rule-text{
  184. font-weight: 500;
  185. font-size: 24rpx;
  186. color: #FFFFFF;
  187. }
  188. ::v-deep .item-left{
  189. background: #442812;
  190. border-radius: 6rpx !important;
  191. text-align: center;
  192. width: 160rpx !important;
  193. }
  194. </style>