index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <view class="gallery" :style="{background:'url('+ bannerImage +')#ffffff'}">
  3. <view style="height: 160rpx;"></view>
  4. <!-- <view class="logo"><re-image imgSrc="/retail/main/img_logo.png" width="300" height="56"></re-image></view> -->
  5. <view class="content">
  6. <view class="news">
  7. <view class="info flex">
  8. <image :src="avatar || defaultAvatar" class="img" width="104" height="104"></image>
  9. <view class="info-text flex-column jcsa">
  10. <view class="info-top flex">
  11. <view class="name">{{name}}</view>
  12. <view class="level flex aic">
  13. <re-image imgSrc="/retail/main/ic_chuji.png" width="40" height="44"></re-image>
  14. <view class="level-text">{{lvName}}</view>
  15. </view>
  16. </view>
  17. <view class="phone">{{username}}</view>
  18. </view>
  19. </view>
  20. <view class="news-total flex jcsa">
  21. <view class="total-item">
  22. <view class="item-num">{{sumPayNum || 0}}</view>
  23. <view class="item-text">总销订单</view>
  24. </view>
  25. <view class="total-item">
  26. <view class="item-num">{{sumGameCurrency || 0}}</view>
  27. <view class="item-text">总销游戏币</view>
  28. </view>
  29. <view class="total-item">
  30. <view class="item-num orange">¥{{sumIncome || 0}}</view>
  31. <view class="item-text">预估总收益</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="list-title-wrapper flex jcsb aic">
  36. <view class="list-title flex aic">
  37. <span class="title-line"></span>
  38. 套餐充值
  39. </view>
  40. <!-- <view class="timer">
  41. 赠送游戏币倒计时
  42. <span>
  43. <span class="lb" id="day">2</span>
  44. <span class="lb" id="hours">17</span>
  45. <span class="lb" id="mins">56</span>
  46. </span>
  47. </view> -->
  48. </view>
  49. <view class="list-wrapper">
  50. <view class="list-item" v-for="(item,index) in list" :key="index">
  51. <view class="item-wrapper">
  52. <view class="sub-title" v-if="item.name">{{item.name}}</view>
  53. <view class="big">
  54. <view class="">
  55. <view class="flex jcsb aic">
  56. <view>
  57. <span class="strong">{{item.gameCurrency}}</span><span class="strong-text">游戏币</span>
  58. </view>
  59. <view>
  60. <span class="symbol">¥</span>
  61. <span class="list-price">{{item.discountPrice}}</span>
  62. </view>
  63. </view>
  64. <view class="original">¥{{item.price}}</view>
  65. </view>
  66. <view class="msg flex jcsb aic">
  67. <view class="msg-left">
  68. <span class="zeng" v-if="item.additionalGameCurrency || item.grabTimes">赠</span>
  69. <span class="og" v-if="item.additionalGameCurrency"><span class="num">{{item.additionalGameCurrency}}</span>游戏币</span>
  70. <!-- <span class="og">
  71. <span class="">+</span>
  72. <span class="">2M</span>
  73. </span> -->
  74. <span class="og red" v-if="item.additionalGameCurrency && item.grabTimes">
  75. <span class=""
  76. style="margin-left:2px">+</span>
  77. <view class="red-box">
  78. <re-image width="30" imgSrc="/retail/main/ic_putonghb.png"></re-image>
  79. <span>红包机会x{{item.grabTimes}}</span>
  80. </view>
  81. </span>
  82. </view>
  83. <span class="time-text">{{item.expireDays}}天有效</span>
  84. <view class="pay-btn" @click="toMall(item.id)">去充值</view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import defaultConfig from '@/config/default.js'
  95. import { packagePage } from '@/apis/main'
  96. import { getUserInfo } from '@/apis/user'
  97. export default {
  98. components: {},
  99. computed: {
  100. statusBarHeight() {
  101. return this.$store.state.info.systemInfo?.statusBarHeight
  102. },
  103. },
  104. data() {
  105. return {
  106. bannerImage: defaultConfig.ossImgUrl + '/retail/main/img_bgtop.png',
  107. title: 'Hello',
  108. navBarHeight: uni.getStorageSync('navBarHeight'),
  109. sumPayNum: '',// 总销订单
  110. sumGameCurrency: '',// 总销游戏币
  111. sumIncome: '',//预估总收益,
  112. avatar:'',
  113. defaultAvatar:'../../static/image/img_touxiang.png',
  114. name:'',
  115. lvName:'',
  116. list:[],
  117. username:'',
  118. }
  119. },
  120. onLoad() {
  121. },
  122. methods: {
  123. // async getInfo(){
  124. // const res = await getUserInfo()
  125. // if(res){
  126. // const { avatar,sumPayNum,sumPay,sumIncome,sumGameCurrency,name } = res
  127. // this.avatar = avatar || '../../static/image/img_touxiang.png'
  128. // this.sumPayNum = sumPayNum
  129. // this.sumGameCurrency = sumGameCurrency
  130. // this.sumIncome = sumIncome
  131. // this.name = name
  132. // uni.setStorageSync('avatar',avatar)
  133. // uni.setStorageSync('sumPayNum',sumPayNum)
  134. // uni.setStorageSync('sumGameCurrency',sumGameCurrency)
  135. // uni.setStorageSync('sumIncome',sumIncome)
  136. // uni.setStorageSync('name',name)
  137. // }
  138. // },
  139. toMall(id){
  140. uni.navigateTo({
  141. url: '/pages/mall/mallRecharge/index?id='+ id
  142. })
  143. },
  144. async getInfo(){
  145. const userInfo = await getUserInfo()
  146. if(userInfo){
  147. const { sumPayNum,sumGameCurrency,sumIncome,avatar,name,lvName,username } = userInfo
  148. this.sumPayNum = sumPayNum
  149. this.sumGameCurrency = sumGameCurrency
  150. this.sumIncome = sumIncome
  151. this.avatar = avatar
  152. this.name = name
  153. this.lvName = lvName
  154. this.username = username
  155. }
  156. },
  157. async getData(){
  158. const res = await packagePage()
  159. if(res){
  160. this.list = res.records
  161. }
  162. }
  163. },
  164. onShow() {
  165. this.getData()
  166. this.getInfo()
  167. },
  168. }
  169. </script>
  170. <style lang="scss" scoped>
  171. .gallery {
  172. background-repeat: no-repeat !important;
  173. background-size: contain !important;
  174. // background-position: top;
  175. width: 100%;
  176. position: absolute;
  177. top: -160rpx;
  178. bottom: 0;
  179. .logo {
  180. // margin-top: 16rpx;
  181. margin-left: 24rpx;
  182. }
  183. .content {
  184. padding: 32rpx 32rpx var(--window-bottom);
  185. .news {
  186. background: #FFFFFF;
  187. box-shadow: 0rpx 6rpx 16rpx 0rpx #E3E6F2;
  188. border-radius: 24rpx;
  189. // margin-top: 48rpx;
  190. padding: 40rpx;
  191. .info {
  192. .img{
  193. flex-shrink: 0;
  194. width: 104rpx;
  195. height: 104rpx;
  196. border-radius: 8rpx;
  197. margin-right: 20rpx;
  198. }
  199. .info-text {
  200. .info-top {
  201. .name {
  202. font-weight: 500;
  203. font-size: 32rpx;
  204. color: #363531;
  205. }
  206. .level {
  207. margin-left: 12rpx;
  208. .level-text {
  209. width: 80rpx;
  210. height: 36rpx;
  211. padding: 6rpx 12rpx 6rpx 20rpx;
  212. background: linear-gradient(130deg, #FFB873 0%, #FEC287 0%, #E69349 100%);
  213. border-radius: 0rpx 18rpx 18rpx 0rpx;
  214. font-weight: 500;
  215. font-size: 24rpx;
  216. color: #FFFFFF;
  217. line-height: 24rpx;
  218. margin-left: -12rpx;
  219. // text-align: left;
  220. }
  221. }
  222. }
  223. }
  224. .phone {
  225. font-weight: 400;
  226. font-size: 28rpx;
  227. color: #989897;
  228. }
  229. }
  230. .news-total {
  231. margin-top: 44rpx;
  232. .item-num {
  233. font-weight: bold;
  234. font-size: 40rpx;
  235. color: #363531;
  236. }
  237. .orange {
  238. color: #FF6400;
  239. }
  240. .item-text {
  241. font-weight: 400;
  242. font-size: 28rpx;
  243. color: #9598A6;
  244. }
  245. }
  246. }
  247. .list-title-wrapper {
  248. margin-top: 48rpx;
  249. .list-title {
  250. color: #363531;
  251. font-weight: bold;
  252. font-size: 36rpx;
  253. line-height: 36rpx;
  254. .title-line {
  255. width: 8rpx;
  256. height: 32rpx;
  257. background-color: #FF8800;
  258. margin-right: 20rpx;
  259. }
  260. }
  261. .timer {
  262. font-size: 24rpx;
  263. .lb {
  264. display: inline-block;
  265. vertical-align: top;
  266. width: 32rpx;
  267. height: 32rpx;
  268. background-color: #FFE4DA;
  269. color: #FF4300;
  270. text-align: center;
  271. line-height: 32rpx;
  272. border-radius: 6rpx;
  273. margin: 0 2rpx;
  274. font-weight: bold;
  275. }
  276. }
  277. }
  278. .list-wrapper {
  279. margin-top: 40rpx;
  280. .list-item {
  281. margin-bottom: 20rpx;
  282. position: relative;
  283. .pay-btn {
  284. background: linear-gradient(140deg, #FF8500 0%, #FFA600 100%);
  285. border-radius: 48rpx;
  286. color: #fff;
  287. width: 168rpx;
  288. height: 64rpx;
  289. text-align: center;
  290. font-weight: 600;
  291. font-size: 28rpx;
  292. color: #FFFFFF;
  293. line-height: 64rpx;
  294. }
  295. .item-wrapper {
  296. background-color: #F6F6F6;
  297. border: 4rpx solid #F6F6F6;
  298. border-radius: 24rpx;
  299. padding: 40rpx 40rpx 24rpx;
  300. position: relative;
  301. border: 2rpx solid #FFB74E;
  302. .sub-title {
  303. position: absolute;
  304. z-index: 10;
  305. left: -2rpx;
  306. top: -2rpx;
  307. padding: 6rpx 16rpx;
  308. font-size: 24rpx;
  309. color: #fff;
  310. line-height: 22rpx;
  311. background: #FF6400;
  312. border-radius: 24rpx 0rpx 24rpx 0rpx;
  313. }
  314. .big {
  315. font-size: 24rpx;
  316. color: #281A13;
  317. font-weight: bold;
  318. .symbol {
  319. color: #2C2B28;
  320. font-weight: bold;
  321. font-size: 32rpx;
  322. }
  323. .list-price {
  324. color: #2C2B28;
  325. font-weight: bold;
  326. font-size: 48rpx;
  327. }
  328. .strong {
  329. font-size: 48rpx;
  330. line-height: 58rpx;
  331. color: #2C2B28;
  332. font-weight: bold;
  333. margin-right: 8rpx;
  334. }
  335. .original{
  336. font-weight: bold;
  337. font-size: 20rpx;
  338. color: #898989;
  339. line-height: 24rpx;
  340. text-decoration-line: line-through;
  341. text-align: right;
  342. }
  343. .strong-text {
  344. font-size: 28rpx;
  345. color: #564C47;
  346. line-height: 28rpx;
  347. font-weight: normal;
  348. }
  349. .hide{
  350. display: none;
  351. }
  352. .msg {
  353. margin-top: 4rpx;
  354. font-size: 32rpx;
  355. color: #2C2B28;
  356. .msg-left {
  357. width: calc(100% - 150rpx);
  358. display: flex;
  359. align-items: center;
  360. white-space: nowrap;
  361. overflow: hidden;
  362. font-weight: normal;
  363. font-size: 28rpx;
  364. }
  365. .og {
  366. color: #FF7C00;
  367. font-weight: bold;
  368. }
  369. .red {
  370. display: flex;
  371. align-items: center;
  372. .red-box {
  373. display: flex;
  374. align-items: center;
  375. }
  376. }
  377. .time-text {
  378. position: absolute;
  379. right: 0;
  380. top: 0;
  381. font-size: 24rpx;
  382. color: #564C47;
  383. // font-weight: normal;
  384. z-index: 200;
  385. background: #E5F1FF;
  386. border-radius: 0rpx 20rpx 0rpx 20rpx;
  387. padding: 6rpx 14rpx;
  388. }
  389. .zeng {
  390. flex-shrink: 0;
  391. object-fit: contain;
  392. display: inline-block;
  393. background-color: #5CB020;
  394. width: 40rpx;
  395. height: 32rpx;
  396. line-height: 32rpx;
  397. color: #fff;
  398. font-size: 24rpx;
  399. border-radius: 8rpx;
  400. text-align: center;
  401. margin-right: 6rpx;
  402. // font-weight: normal;
  403. }
  404. }
  405. }
  406. .sm {
  407. font-size: 28rpx;
  408. margin-top: 16rpx;
  409. color: #74706D;
  410. padding-right: 20rpx;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. </style>