index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="gallery" :style="{background:'url('+ bannerImage +')#ffffff'}">
  3. <view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></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: uni.getStorageSync('userInfo').sumPayNum,// 总销订单
  110. sumGameCurrency: uni.getStorageSync('userInfo').sumGameCurrency,// 总销游戏币
  111. sumIncome: uni.getStorageSync('userInfo').sumIncome,//预估总收益,
  112. avatar:uni.getStorageSync('avatar'),
  113. defaultAvatar:'../../static/image/img_touxiang.png',
  114. name:uni.getStorageSync('userInfo').name,
  115. lvName:uni.getStorageSync('userInfo').lvName,
  116. list:[],
  117. username:uni.getStorageSync('username'),
  118. }
  119. },
  120. onLoad() {
  121. },
  122. methods: {
  123. updateAvatarFromStorage() {
  124. // 从本地存储同步获取 avatar 并更新组件状态
  125. this.avatar = uni.getStorageSync('avatar');
  126. },
  127. // async getInfo(){
  128. // const res = await getUserInfo()
  129. // if(res){
  130. // const { avatar,sumPayNum,sumPay,sumIncome,sumGameCurrency,name } = res
  131. // this.avatar = avatar || '../../static/image/img_touxiang.png'
  132. // this.sumPayNum = sumPayNum
  133. // this.sumGameCurrency = sumGameCurrency
  134. // this.sumIncome = sumIncome
  135. // this.name = name
  136. // uni.setStorageSync('avatar',avatar)
  137. // uni.setStorageSync('sumPayNum',sumPayNum)
  138. // uni.setStorageSync('sumGameCurrency',sumGameCurrency)
  139. // uni.setStorageSync('sumIncome',sumIncome)
  140. // uni.setStorageSync('name',name)
  141. // }
  142. // },
  143. toMall(id){
  144. uni.navigateTo({
  145. url: '/pages/mall/mallRecharge/index?id='+ id
  146. })
  147. },
  148. async getData(){
  149. const res = await packagePage()
  150. if(res){
  151. this.list = res.records
  152. }
  153. }
  154. },
  155. onShow() {
  156. this.getData()
  157. this.updateAvatarFromStorage()
  158. },
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .gallery {
  163. background-repeat: no-repeat !important;
  164. background-size: contain !important;
  165. // background-position: top;
  166. width: 100%;
  167. position: absolute;
  168. top: 0;
  169. bottom: 0;
  170. .logo {
  171. margin-top: 16rpx;
  172. margin-left: 24rpx;
  173. }
  174. .content {
  175. padding: 0 32rpx 120rpx;
  176. .news {
  177. background: #FFFFFF;
  178. box-shadow: 0rpx 6rpx 16rpx 0rpx #E3E6F2;
  179. border-radius: 24rpx;
  180. margin-top: 48rpx;
  181. padding: 40rpx;
  182. .info {
  183. .img{
  184. flex-shrink: 0;
  185. width: 104rpx;
  186. height: 104rpx;
  187. border-radius: 8rpx;
  188. margin-right: 20rpx;
  189. }
  190. .info-text {
  191. .info-top {
  192. .name {
  193. font-weight: 500;
  194. font-size: 32rpx;
  195. color: #363531;
  196. }
  197. .level {
  198. margin-left: 12rpx;
  199. .level-text {
  200. width: 80rpx;
  201. height: 36rpx;
  202. padding: 6rpx 12rpx 6rpx 20rpx;
  203. background: linear-gradient(130deg, #FFB873 0%, #FEC287 0%, #E69349 100%);
  204. border-radius: 0rpx 18rpx 18rpx 0rpx;
  205. font-weight: 500;
  206. font-size: 24rpx;
  207. color: #FFFFFF;
  208. line-height: 24rpx;
  209. margin-left: -12rpx;
  210. // text-align: left;
  211. }
  212. }
  213. }
  214. }
  215. .phone {
  216. font-weight: 400;
  217. font-size: 28rpx;
  218. color: #989897;
  219. }
  220. }
  221. .news-total {
  222. margin-top: 44rpx;
  223. .item-num {
  224. font-weight: bold;
  225. font-size: 40rpx;
  226. color: #363531;
  227. }
  228. .orange {
  229. color: #FF6400;
  230. }
  231. .item-text {
  232. font-weight: 400;
  233. font-size: 28rpx;
  234. color: #9598A6;
  235. }
  236. }
  237. }
  238. .list-title-wrapper {
  239. margin-top: 48rpx;
  240. .list-title {
  241. color: #363531;
  242. font-weight: bold;
  243. font-size: 36rpx;
  244. line-height: 36rpx;
  245. .title-line {
  246. width: 8rpx;
  247. height: 32rpx;
  248. background-color: #FF8800;
  249. margin-right: 20rpx;
  250. }
  251. }
  252. .timer {
  253. font-size: 24rpx;
  254. .lb {
  255. display: inline-block;
  256. vertical-align: top;
  257. width: 32rpx;
  258. height: 32rpx;
  259. background-color: #FFE4DA;
  260. color: #FF4300;
  261. text-align: center;
  262. line-height: 32rpx;
  263. border-radius: 6rpx;
  264. margin: 0 2rpx;
  265. font-weight: bold;
  266. }
  267. }
  268. }
  269. .list-wrapper {
  270. margin-top: 40rpx;
  271. .list-item {
  272. margin-bottom: 20rpx;
  273. position: relative;
  274. .pay-btn {
  275. background: linear-gradient(140deg, #FF8500 0%, #FFA600 100%);
  276. border-radius: 48rpx;
  277. color: #fff;
  278. width: 168rpx;
  279. height: 64rpx;
  280. text-align: center;
  281. font-weight: 600;
  282. font-size: 28rpx;
  283. color: #FFFFFF;
  284. line-height: 64rpx;
  285. }
  286. .item-wrapper {
  287. background-color: #F6F6F6;
  288. border: 4rpx solid #F6F6F6;
  289. border-radius: 24rpx;
  290. padding: 40rpx 40rpx 24rpx;
  291. position: relative;
  292. border: 2rpx solid #FFB74E;
  293. .sub-title {
  294. position: absolute;
  295. z-index: 10;
  296. left: -2rpx;
  297. top: -2rpx;
  298. padding: 6rpx 16rpx;
  299. font-size: 24rpx;
  300. color: #fff;
  301. line-height: 22rpx;
  302. background: #FF6400;
  303. border-radius: 24rpx 0rpx 24rpx 0rpx;
  304. }
  305. .big {
  306. font-size: 24rpx;
  307. color: #281A13;
  308. font-weight: bold;
  309. .symbol {
  310. color: #2C2B28;
  311. font-weight: bold;
  312. font-size: 32rpx;
  313. }
  314. .list-price {
  315. color: #2C2B28;
  316. font-weight: bold;
  317. font-size: 48rpx;
  318. }
  319. .strong {
  320. font-size: 48rpx;
  321. line-height: 58rpx;
  322. color: #2C2B28;
  323. font-weight: bold;
  324. margin-right: 8rpx;
  325. }
  326. .original{
  327. font-weight: bold;
  328. font-size: 20rpx;
  329. color: #898989;
  330. line-height: 24rpx;
  331. text-decoration-line: line-through;
  332. text-align: right;
  333. }
  334. .strong-text {
  335. font-size: 28rpx;
  336. color: #564C47;
  337. line-height: 28rpx;
  338. font-weight: normal;
  339. }
  340. .hide{
  341. display: none;
  342. }
  343. .msg {
  344. margin-top: 4rpx;
  345. font-size: 32rpx;
  346. color: #2C2B28;
  347. .msg-left {
  348. width: calc(100% - 150rpx);
  349. display: flex;
  350. align-items: center;
  351. white-space: nowrap;
  352. overflow: hidden;
  353. font-weight: normal;
  354. font-size: 28rpx;
  355. .num{
  356. }
  357. }
  358. .og {
  359. color: #FF7C00;
  360. font-weight: bold;
  361. }
  362. .red {
  363. display: flex;
  364. align-items: center;
  365. .red-box {
  366. display: flex;
  367. align-items: center;
  368. }
  369. }
  370. .time-text {
  371. position: absolute;
  372. right: 0;
  373. top: 0;
  374. font-size: 24rpx;
  375. color: #564C47;
  376. // font-weight: normal;
  377. z-index: 200;
  378. background: #E5F1FF;
  379. border-radius: 0rpx 20rpx 0rpx 20rpx;
  380. padding: 6rpx 14rpx;
  381. }
  382. .zeng {
  383. flex-shrink: 0;
  384. object-fit: contain;
  385. display: inline-block;
  386. background-color: #5CB020;
  387. width: 40rpx;
  388. height: 32rpx;
  389. line-height: 32rpx;
  390. color: #fff;
  391. font-size: 24rpx;
  392. border-radius: 8rpx;
  393. text-align: center;
  394. margin-right: 6rpx;
  395. // font-weight: normal;
  396. }
  397. }
  398. }
  399. .sm {
  400. font-size: 28rpx;
  401. margin-top: 16rpx;
  402. color: #74706D;
  403. padding-right: 20rpx;
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. </style>