exchange.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. <template>
  2. <view>
  3. <custom-nav title="礼品兑换"></custom-nav>
  4. <view class="giftContainer">
  5. <!-- <view class="status_bar" :style="style">
  6. <view
  7. :style="[{'height': customBarH + 'px', 'line-height': customBarH + 'px','padding-top': statusBarH + 'px' }]"
  8. class="nav_box">
  9. <text class="back cuIcon-back"></text>
  10. <text style="color: #333;font-size: 32rpx;">礼品兑换</text>
  11. <view style="width: 50rpx;"></view>
  12. </view>
  13. </view> -->
  14. <view v-if="message" class="message">
  15. <view class="icon"><text>通知</text></view>
  16. <view class="text">
  17. <view class="scroll">{{ message }}</view>
  18. </view>
  19. </view>
  20. <view class="banner">
  21. <view class="num">
  22. <text class="spec" v-if="userServerInfo">{{ userServerInfo.bonus }}</text>
  23. <text>奖学金</text>
  24. </view>
  25. <view class="flex">
  26. <view class="mingxi" @click="goDetail">
  27. 奖学金明细
  28. </view>
  29. <!-- <view style="margin-left: 10rpx;" class="mingxi" @click="showImg">
  30. 发圈分享
  31. </view> -->
  32. </view>
  33. <!-- <view class="num">兑换礼包,福利优人一步</view> -->
  34. </view>
  35. <view class="fixedHeader">
  36. <view class="num">
  37. <text>奖学金:</text>
  38. <text class="spec" v-if="userServerInfo">{{ userServerInfo.bonus }}</text>
  39. </view>
  40. <view v-if="userServerInfo">
  41. <view v-if="userServerInfo.type === 1 || userServerInfo.type === 2" class="title" @tap="exchangerecord">
  42. <text>{{ userServerInfo.type === 2 ? '礼品详情' : '兑换记录' }}</text>
  43. </view>
  44. <!-- <view v-if="userServerInfo.type === 1 || userServerInfo.type === 2" class="title" @tap="exchangerecord">
  45. <text>兑换记录</text>
  46. </view> -->
  47. </view>
  48. </view>
  49. <view class="list" v-if="list.length > 0">
  50. <view v-for="item in list" :key="item.id" class="item" @click="exchange(item)">
  51. <view class="avatar" :style="{ backgroundImage: `url(${item.img})` }" @click.stop="priview(item.img)">
  52. <view v-if="!Number(item.surplus)" class="none"><text>已兑完</text></view>
  53. </view>
  54. <view class="info">
  55. <view class="title">{{ item.name }}</view>
  56. <view class="info-num">
  57. <view class="info-other">限量{{ item.total }}份</view>
  58. <view class="info-status" v-if="item.exchanged">已兑换</view>
  59. </view>
  60. <view class="bottom">
  61. <view class="money">
  62. <text class="spec">{{ item.price }}</text>
  63. <text>奖学金</text>
  64. </view>
  65. <view class="btn" v-if="!Number(item.surplus)"
  66. :class="Number(item.surplus) && isCan ? '' : 'disabled'">已兑完</view>
  67. <view class="btn" v-else :class="Number(item.surplus) && isCan ? '' : 'disabled'">立即兑换</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="share_show" v-if="shareShow" @click="shareShow = false">
  73. <view class="share_con flexCC">
  74. <!-- <text class="iconfont iconguanbi">
  75. <image src="../../static/new_challenge/error.png" mode="widthFix" style="width: 48rpx;" @click="shareShow = false"></image>
  76. </text>
  77. -->
  78. <view class="canvas">
  79. <canvas canvas-id="canvas" style="width: 100%;height:100%;" id="canvas">
  80. <img :src="poster" class="poster_img" mode="widthFix" />
  81. </canvas>
  82. </view>
  83. <view class="save_img">长按图片保存到本地</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import {
  91. api_getExchangeList,
  92. GetBonus,
  93. api_record,
  94. getMessage
  95. } from '../../api.js';
  96. export default {
  97. data() {
  98. return {
  99. shareShow: false,
  100. poster: '',
  101. canvasWidth: '',
  102. canvasHeight: '',
  103. message: '',
  104. model: '',
  105. customBarH: 0,
  106. statusBarH: 0,
  107. // Imglist:[
  108. // {
  109. // cover: require('../../static/huan.jpg'),
  110. // name: '手环',
  111. // num: 1
  112. // },
  113. // {
  114. // cover: require('../../static/huan.jpg'),
  115. // name: '护心卡',
  116. // num: 1
  117. // },
  118. // {
  119. // cover: require('../../static/huan.jpg'),
  120. // name: '毛毯红色',
  121. // num: 1
  122. // },
  123. // {
  124. // cover: require('../../static/huan.jpg'),
  125. // name: '远红外手环',
  126. // num: 1
  127. // },
  128. // {
  129. // cover: require('../../static/huan.jpg'),
  130. // name: '远红外手环',
  131. // num: 1
  132. // },
  133. // {
  134. // cover: require('../../static/huan.jpg'),
  135. // name: '远红外手环',
  136. // num: 1
  137. // }
  138. // ],
  139. pageTitle: '礼品兑换',
  140. scrollViewHeight: 0,
  141. list: [],
  142. };
  143. },
  144. computed: {
  145. userServerInfo() {
  146. //用户服务器信息
  147. return this.$store.state.userServerInfo;
  148. },
  149. isCan() {
  150. return this.$store.state.userServerInfo && this.$store.state.userServerInfo.status == 3 ? true : false;
  151. },
  152. style() {
  153. let _style = `height: ${this.customBarH}px;margin-bottom:${this.statusBarH}px`
  154. return _style
  155. }
  156. },
  157. mounted() {
  158. let menuButtonObject = uni.getMenuButtonBoundingClientRect(); //获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
  159. uni.getSystemInfo({ //获取系统信息
  160. success: res => {
  161. let navHeight = menuButtonObject.height + (menuButtonObject.top - res.statusBarHeight) *
  162. 2; //导航栏高度=菜单按钮高度+(菜单按钮与顶部距离-状态栏高度)*2
  163. // 导航栏(胶囊)高度
  164. this.customBarH = navHeight;
  165. // 状态栏(顶部)高度
  166. this.statusBarH = res.statusBarHeight
  167. },
  168. fail(err) {
  169. console.log(err);
  170. }
  171. })
  172. },
  173. // onLoad:function(option){
  174. // this.type=option.type
  175. // console.log('我是type值:',this.type)
  176. // },
  177. onShow() {
  178. console.log(this.userServerInfo)
  179. this.getGiftList()
  180. this.getBound()
  181. this.getmessageInfo()
  182. },
  183. onPullDownRefresh() {
  184. this.getGiftList()
  185. this.getBound()
  186. setTimeout(function() {
  187. uni.stopPullDownRefresh()
  188. }, 1500);
  189. },
  190. methods: {
  191. getmessageInfo() {
  192. this.$ajax.get(getMessage).then(([, {
  193. data: res
  194. }]) => {
  195. this.message = res.data.map((value) => value.content).join(' ')
  196. console.log(111, this.message)
  197. })
  198. },
  199. showImg() {
  200. this.$ajax.get(api_record).then(([, {
  201. data: res
  202. }]) => {
  203. if (res.code === 200) {
  204. // this.Imglist = res.data.list
  205. if (this.Imglist.length === 0) {
  206. uni.showToast({
  207. title: '您还没有兑换礼品',
  208. icon: 'none'
  209. })
  210. return
  211. }
  212. uni.getSystemInfo({
  213. success: res => {
  214. this.model = res.model
  215. this.canvasWidth = res.windowWidth / 375
  216. this.canvasHeight = res.windowHeight
  217. this.shareShow = true
  218. this.drawPoster()
  219. }
  220. })
  221. } else {
  222. uni.showToast({
  223. title: res.message || '获取失败',
  224. icon: 'none'
  225. })
  226. }
  227. })
  228. },
  229. drawPoster() {
  230. let that = this;
  231. uni.getImageInfo({
  232. src: this.userServerInfo.name,
  233. success: res => {
  234. uni.showLoading({
  235. title: '图片加载中...'
  236. });
  237. let ctx = uni.createCanvasContext('canvas');
  238. let rpx = that.canvasWidth;
  239. // ctx.drawImage('../../static/bg1.png', 0, 0, 270 * rpx, 480 * rpx);
  240. ctx.drawImage('../../static/bg3.jpg', 0, 0, 270 * rpx, 480 * rpx);
  241. ctx.drawImage('../../static/bg2.png', 0, 0, 270 * rpx, 480 * rpx);
  242. ctx.font = 'noraml bold 15px pingfang';
  243. ctx.textAlign = 'center';
  244. ctx.setFillStyle('#F2EDCF');
  245. ctx.fillText(that.userServerInfo.name.length > 6 ? that.userServerInfo.name.slice(0,
  246. 6) : that.userServerInfo.name, uni.upx2px(281), uni.upx2px(514));
  247. ctx.beginPath();
  248. if (that.Imglist.length === 1) {
  249. that.getOne(ctx)
  250. }
  251. if (that.Imglist.length === 2) {
  252. that.getTwo(ctx)
  253. }
  254. if (that.Imglist.length === 3) {
  255. that.getThree(ctx)
  256. }
  257. if (that.Imglist.length === 4) {
  258. that.getFour(ctx)
  259. }
  260. if (that.Imglist.length === 5) {
  261. that.getFive(ctx)
  262. }
  263. if (that.Imglist.length === 6) {
  264. that.getSix(ctx)
  265. }
  266. ctx.beginPath();
  267. ctx.arc(uni.upx2px(96) / 2 + uni.upx2px(236), uni.upx2px(97) / 2 + uni.upx2px(360),
  268. uni.upx2px(97) / 2,
  269. 0, Math.PI * 2, false); // 画一个圆形裁剪区域
  270. ctx.clip(); // 裁剪
  271. ctx.drawImage(res.path, uni.upx2px(236), uni.upx2px(360), uni.upx2px(97), uni.upx2px(
  272. 97));
  273. ctx.restore(); //恢复之前保存的绘图上下文
  274. setTimeout(res => {
  275. ctx.draw(false, () => {
  276. uni.canvasToTempFilePath({
  277. width: 270 * rpx,
  278. height: 480 * rpx,
  279. canvasId: 'canvas',
  280. success: res => {
  281. uni.hideLoading();
  282. if (this.model == 'iPhone') {
  283. this.poster = this.dataURLtoFile(res
  284. .tempFilePath).name;
  285. } else {
  286. let url = res.tempFilePath.replace(
  287. /\. +/g, '');
  288. this.poster = url.replace(/[\r\n]/g,
  289. '');
  290. }
  291. },
  292. fail: () => {
  293. uni.hideLoading()
  294. }
  295. });
  296. });
  297. }, 500);
  298. }
  299. })
  300. },
  301. getOne(ctx) {
  302. ctx.setFillStyle('#ED1A08');
  303. ctx.font = 'noraml bold 11px pingfang';
  304. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(268), uni.upx2px(850));
  305. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(195), uni.upx2px(670), uni.upx2px(145), uni.upx2px(145));
  306. },
  307. getTwo(ctx) {
  308. ctx.setFillStyle('#ED1A08');
  309. ctx.font = 'noraml bold 11px pingfang';
  310. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(165), uni.upx2px(840));
  311. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(85), uni.upx2px(650), uni.upx2px(160), uni.upx2px(160));
  312. ctx.fillText(this.Imglist[1].name + 'x' + this.Imglist[1].num, uni.upx2px(360), uni.upx2px(840));
  313. ctx.drawImage(this.Imglist[1].cover, uni.upx2px(285), uni.upx2px(650), uni.upx2px(160), uni.upx2px(160));
  314. },
  315. getThree(ctx) {
  316. ctx.setFillStyle('#ED1A08');
  317. ctx.font = 'noraml bold 10px pingfang';
  318. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(110), uni.upx2px(840));
  319. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(40), uni.upx2px(650), uni.upx2px(145), uni.upx2px(145));
  320. ctx.fillText(this.Imglist[1].name + 'x' + this.Imglist[1].num, uni.upx2px(270), uni.upx2px(840));
  321. ctx.drawImage(this.Imglist[1].cover, uni.upx2px(200), uni.upx2px(650), uni.upx2px(145), uni.upx2px(145));
  322. ctx.fillText(this.Imglist[2].name + 'x' + this.Imglist[2].num, uni.upx2px(430), uni.upx2px(840));
  323. ctx.drawImage(this.Imglist[2].cover, uni.upx2px(360), uni.upx2px(650), uni.upx2px(145), uni.upx2px(145));
  324. },
  325. getFour(ctx) {
  326. ctx.setFillStyle('#ED1A08');
  327. ctx.font = 'noraml bold 9px pingfang';
  328. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(172), uni.upx2px(765));
  329. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(120), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  330. ctx.fillText(this.Imglist[1].name + 'x' + this.Imglist[1].num, uni.upx2px(365), uni.upx2px(760));
  331. ctx.drawImage(this.Imglist[1].cover, uni.upx2px(310), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  332. ctx.fillText(this.Imglist[2].name + 'x' + this.Imglist[2].num, uni.upx2px(172), uni.upx2px(905));
  333. ctx.drawImage(this.Imglist[2].cover, uni.upx2px(120), uni.upx2px(780), uni.upx2px(100), uni.upx2px(100));
  334. ctx.fillText(this.Imglist[3].name + 'x' + this.Imglist[3].num, uni.upx2px(365), uni.upx2px(905));
  335. ctx.drawImage(this.Imglist[3].cover, uni.upx2px(310), uni.upx2px(780), uni.upx2px(100), uni.upx2px(100));
  336. },
  337. getFive(ctx) {
  338. ctx.setFillStyle('#ED1A08');
  339. ctx.font = 'noraml bold 9px pingfang';
  340. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(120), uni.upx2px(768));
  341. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(70), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  342. ctx.fillText(this.Imglist[1].name + 'x' + this.Imglist[1].num, uni.upx2px(270), uni.upx2px(768));
  343. ctx.drawImage(this.Imglist[1].cover, uni.upx2px(220), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  344. ctx.fillText(this.Imglist[2].name + 'x' + this.Imglist[2].num, uni.upx2px(420), uni.upx2px(768));
  345. ctx.drawImage(this.Imglist[2].cover, uni.upx2px(370), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  346. ctx.fillText(this.Imglist[3].name + 'x' + this.Imglist[3].num, uni.upx2px(190), uni.upx2px(910));
  347. ctx.drawImage(this.Imglist[3].cover, uni.upx2px(140), uni.upx2px(785), uni.upx2px(100), uni.upx2px(100));
  348. ctx.fillText(this.Imglist[4].name + 'x' + this.Imglist[4].num, uni.upx2px(350), uni.upx2px(910));
  349. ctx.drawImage(this.Imglist[4].cover, uni.upx2px(298), uni.upx2px(785), uni.upx2px(100), uni.upx2px(100));
  350. },
  351. getSix(ctx) {
  352. ctx.setFillStyle('#ED1A08');
  353. ctx.font = 'noraml bold 9px pingfang';
  354. ctx.fillText(this.Imglist[0].name + 'x' + this.Imglist[0].num, uni.upx2px(120), uni.upx2px(768));
  355. ctx.drawImage(this.Imglist[0].cover, uni.upx2px(70), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  356. ctx.fillText(this.Imglist[1].name + 'x' + this.Imglist[1].num, uni.upx2px(270), uni.upx2px(768));
  357. ctx.drawImage(this.Imglist[1].cover, uni.upx2px(220), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  358. ctx.fillText(this.Imglist[2].name + 'x' + this.Imglist[2].num, uni.upx2px(420), uni.upx2px(768));
  359. ctx.drawImage(this.Imglist[2].cover, uni.upx2px(370), uni.upx2px(640), uni.upx2px(100), uni.upx2px(100));
  360. ctx.fillText(this.Imglist[3].name + 'x' + this.Imglist[3].num, uni.upx2px(120), uni.upx2px(910));
  361. ctx.drawImage(this.Imglist[3].cover, uni.upx2px(70), uni.upx2px(785), uni.upx2px(100), uni.upx2px(100));
  362. ctx.fillText(this.Imglist[4].name + 'x' + this.Imglist[4].num, uni.upx2px(270), uni.upx2px(910));
  363. ctx.drawImage(this.Imglist[4].cover, uni.upx2px(220), uni.upx2px(785), uni.upx2px(100), uni.upx2px(100));
  364. ctx.fillText(this.Imglist[5].name + 'x' + this.Imglist[5].num, uni.upx2px(420), uni.upx2px(910));
  365. ctx.drawImage(this.Imglist[5].cover, uni.upx2px(370), uni.upx2px(785), uni.upx2px(100), uni.upx2px(100));
  366. },
  367. dataURLtoFile(dataurl, filename = 'file') {
  368. let arr = dataurl.split(',');
  369. let mime = arr[0].match(/:(.*?);/)[1];
  370. let suffix = mime.split('/')[1];
  371. let bstr = atob(arr[1]);
  372. let n = bstr.length;
  373. let u8arr = new Uint8Array(n);
  374. while (n--) {
  375. u8arr[n] = bstr.charCodeAt(n);
  376. }
  377. return new File([u8arr], `${filename}.${suffix}`, {
  378. type: mime
  379. });
  380. },
  381. goDetail() {
  382. uni.navigateTo({
  383. url: "./detail"
  384. })
  385. },
  386. goBack() {
  387. uni.redirectTo({
  388. url: "../other/other"
  389. })
  390. },
  391. getGiftList() {
  392. // uni.showLoading();
  393. this.$ajax.get(api_getExchangeList).then(([, {
  394. data: res
  395. }]) => {
  396. if (res.code == 200) {
  397. //获取兑换礼品列表
  398. this.list = res.data.list;
  399. console.log(res.data.list)
  400. // uni.hideLoading();
  401. } else {
  402. uni.showToast({
  403. title: res.message || '获取失败',
  404. duration: 2000,
  405. icon: 'none'
  406. })
  407. }
  408. });
  409. },
  410. getBound() {
  411. this.$ajax.get(GetBonus).then(([, {
  412. data: res
  413. }]) => {
  414. //获取奖学金
  415. this.userServerInfo.bonus = res.data.bonus
  416. console.log(res.data.bonus)
  417. });
  418. },
  419. exchangerecord() {
  420. //进入兑换记录页面
  421. // if (this.userServerInfo.type === 1 || this.userServerInfo.type === 2) {
  422. // uni.navigateTo({ url: '../mygift/mygift' })
  423. // } else {
  424. // uni.showModal({
  425. // content: '无兑换记录',
  426. // showCancel: false
  427. // })
  428. // }
  429. if (this.userServerInfo.type === 1) {
  430. uni.navigateTo({
  431. url: '../exchangerecord/exchangerecord'
  432. })
  433. } else if (this.userServerInfo.type === 2) {
  434. uni.navigateTo({
  435. url: '../mygift/mygift'
  436. })
  437. } else {
  438. uni.showModal({
  439. content: '无兑换记录',
  440. showCancel: false
  441. })
  442. }
  443. },
  444. priview(src) {
  445. // 预览
  446. uni.previewImage({
  447. urls: [src]
  448. });
  449. },
  450. exchange(data) {
  451. // 兑换
  452. // getApp().globalData.detail = data; //把兑换列表保存到 globalData 中
  453. // uni.navigateTo({
  454. // url: '../detail/detail' //去商品详情页面时
  455. // });
  456. // return false;
  457. // status 不等于3 提示兑换还未开始
  458. if (!this.isCan) {
  459. uni.showModal({
  460. content: '兑换还未开始',
  461. showCancel: false
  462. });
  463. return false;
  464. }
  465. if (data.surplus) {
  466. //如果有货
  467. getApp().globalData.detail = data; //把兑换列表保存到 globalData 中
  468. uni.navigateTo({
  469. url: '../detail/detail' //去商品详情页面时
  470. });
  471. } else {
  472. uni.showModal({
  473. content: '来晚了!礼品已兑换完毕!再看看别的吧!',
  474. showCancel: false
  475. });
  476. }
  477. }
  478. }
  479. };
  480. </script>
  481. <style lang="scss" scoped>
  482. .flexCC {
  483. display: flex;
  484. flex-direction: column;
  485. justify-content: center;
  486. align-items: center;
  487. }
  488. .share_show {
  489. width: 100%;
  490. height: 100vh;
  491. position: fixed;
  492. top: 0;
  493. left: 0;
  494. background-color: rgba(0, 0, 0, 0.7);
  495. z-index: 9999;
  496. .share_con {
  497. width: 80%;
  498. margin: 0 auto;
  499. height: 100%;
  500. z-index: 999999;
  501. .canvas {
  502. width: 540rpx;
  503. height: 960rpx;
  504. position: relative;
  505. #canvas {
  506. width: 540rpx;
  507. height: 960rpx;
  508. position: absolute;
  509. top: 0;
  510. left: 0;
  511. }
  512. .poster_img {
  513. -webkit-touch-callout: default;
  514. width: 540rpx;
  515. height: 960rpx;
  516. display: block;
  517. }
  518. img[src=''],
  519. img:not([src]) {
  520. opacity: 0;
  521. }
  522. }
  523. .save_img {
  524. color: #fff;
  525. width: 100%;
  526. text-align: center;
  527. font-size: 40rpx;
  528. margin-top: 20rpx;
  529. }
  530. .iconfont {
  531. position: absolute;
  532. top: 4vh;
  533. right: 25rpx;
  534. color: #dedede;
  535. font-size: 60rpx;
  536. z-index: 999;
  537. }
  538. }
  539. .sub_btn {
  540. margin-top: 76rpx;
  541. }
  542. }
  543. page {
  544. height: auto;
  545. display: flex;
  546. flex-direction: column;
  547. // .status_bar {
  548. // width: 100vw;
  549. // position: relative;
  550. // z-index: 10;
  551. // margin: 0;
  552. // .nav_box {
  553. // width: 100%;
  554. // padding: 0 20px;
  555. // font-size: 40rpx;
  556. // .back {
  557. // margin-right: 8rpx;
  558. // }
  559. // }
  560. // position: fixed;
  561. // top: 0;
  562. // padding-top: 40rpx;
  563. // left: 25rpx;
  564. // height: 128rpx;
  565. // z-index: 1000;
  566. // line-height: 88rpx;
  567. // background-color: #fff;
  568. // width: 100%;
  569. // display: flex;
  570. // justify-content: space-between;
  571. // align-items: center;
  572. // }
  573. .giftContainer {
  574. flex: 1;
  575. overflow: hidden;
  576. padding: 30rpx;
  577. box-sizing: border-box;
  578. // margin-top: 110rpx;
  579. .message {
  580. width: 100%;
  581. display: flex;
  582. align-items: center;
  583. padding: 0 42rpx 0 14rpx;
  584. box-sizing: border-box;
  585. background-color: #fff4f3;
  586. height: 62rpx;
  587. border-radius: 62rpx;
  588. margin-bottom: 30rpx;
  589. .icon {
  590. width: 128rpx;
  591. height: 46rpx;
  592. background: linear-gradient(88deg, #ffc401 0%, #fe2400 41%, #fe0000 100%);
  593. border-radius: 45rpx;
  594. display: flex;
  595. align-items: center;
  596. justify-content: center;
  597. color: #ffffff;
  598. font-size: 28rpx;
  599. margin-right: 14rpx;
  600. &::before {
  601. content: '';
  602. display: block;
  603. width: 28rpx;
  604. height: 28rpx;
  605. background: url(../../static/gift/1.png) 100% center no-repeat;
  606. background-size: 100%;
  607. margin-right: 6rpx;
  608. }
  609. }
  610. .text {
  611. flex: 1;
  612. height: 40rpx;
  613. overflow: hidden;
  614. .scroll {
  615. height: 40rpx;
  616. line-height: 40rpx;
  617. white-space: nowrap;
  618. color: #ea4a41;
  619. font-weight: 28rpx;
  620. animation: scroll-left-right 12s linear infinite;
  621. }
  622. }
  623. }
  624. .banner {
  625. width: 100%;
  626. height: 240rpx;
  627. background: linear-gradient(270deg, #f97c55 0%, #f44545 100%);
  628. border-top-left-radius: 24rpx;
  629. border-top-right-radius: 24rpx;
  630. position: relative;
  631. padding: 60rpx 40rpx;
  632. box-sizing: border-box;
  633. display: flex;
  634. flex-direction: column;
  635. justify-content: space-between;
  636. margin-bottom: 30rpx;
  637. .num {
  638. color: #ffffff;
  639. font-size: 32rpx;
  640. line-height: 44rpx;
  641. .spec {
  642. font-size: 76rpx;
  643. margin-right: 10rpx;
  644. }
  645. margin-bottom: 10rpx;
  646. }
  647. .mingxi {
  648. width: 184rpx;
  649. height: 64rpx;
  650. background: linear-gradient(180deg, #FCEAC0 0%, #FFD57D 100%);
  651. border-radius: 32rpx;
  652. color: #FB231F;
  653. font-size: 28rpx;
  654. text-align: center;
  655. line-height: 64rpx;
  656. }
  657. &::after {
  658. content: '';
  659. display: block;
  660. width: calc(100% + 30rpx);
  661. height: 28rpx;
  662. background: linear-gradient(180deg, rgba(234, 74, 65, 0) 0%, rgba(234, 74, 65, 0.35) 100%);
  663. border-radius: 28rpx;
  664. position: absolute;
  665. left: -15rpx;
  666. right: -15rpx;
  667. bottom: -14rpx;
  668. }
  669. &::before {
  670. content: '';
  671. display: block;
  672. width: 170rpx;
  673. height: 170rpx;
  674. background-image: url('https://api.jiuweiyun.cn/public/uploads/weapp/icon/2.png');
  675. background-position: center;
  676. background-size: 100%;
  677. background-repeat: no-repeat;
  678. position: absolute;
  679. top: 50%;
  680. right: 30rpx;
  681. transform: translateY(-50%);
  682. }
  683. }
  684. .fixedHeader {
  685. width: 100%;
  686. display: flex;
  687. align-items: center;
  688. justify-content: space-between;
  689. margin-bottom: 30rpx;
  690. .num {
  691. display: flex;
  692. align-items: center;
  693. color: #333333;
  694. font-size: 32rpx;
  695. line-height: 56rpx;
  696. .spec {
  697. color: #ea4a41;
  698. font-size: 40rpx;
  699. }
  700. &::before {
  701. content: '';
  702. display: block;
  703. width: 40rpx;
  704. height: 40rpx;
  705. background-image: url(../../static/gift/3.png);
  706. background-size: 100%;
  707. background-position: center;
  708. background-repeat: no-repeat;
  709. margin-right: 10rpx;
  710. }
  711. }
  712. .title {
  713. display: flex;
  714. align-items: center;
  715. color: #999999;
  716. font-size: 32rpx;
  717. &::before {
  718. content: '';
  719. display: block;
  720. width: 34rpx;
  721. height: 34rpx;
  722. background-image: url(../../static/gift/4.png);
  723. background-size: 100%;
  724. background-position: center;
  725. background-repeat: no-repeat;
  726. margin-right: 10rpx;
  727. }
  728. }
  729. }
  730. .list {
  731. width: 100%;
  732. .item {
  733. width: 100%;
  734. display: flex;
  735. align-items: stretch;
  736. justify-content: space-between;
  737. margin-bottom: 30rpx;
  738. .avatar {
  739. width: 260rpx;
  740. height: 260rpx;
  741. background-color: #f9f9fb;
  742. position: relative;
  743. border-radius: 16rpx;
  744. display: flex;
  745. align-items: center;
  746. justify-content: center;
  747. margin-right: 20rpx;
  748. background-position: center;
  749. background-repeat: no-repeat;
  750. background-size: 100%;
  751. overflow: hidden;
  752. .none {
  753. position: absolute;
  754. top: 0;
  755. bottom: 0;
  756. right: 0;
  757. left: 0;
  758. background: rgba(0, 0, 0, 0.5);
  759. display: flex;
  760. align-items: center;
  761. justify-content: center;
  762. color: #ffffff;
  763. font-size: 32rpx;
  764. }
  765. }
  766. .info {
  767. flex: 1;
  768. overflow: hidden;
  769. display: flex;
  770. flex-direction: column;
  771. justify-content: space-between;
  772. .title {
  773. color: #333333;
  774. font-size: 32rpx;
  775. line-height: 44rpx;
  776. width: 100%;
  777. height: 44rpx;
  778. overflow: hidden;
  779. font-weight: bold;
  780. margin-bottom: 20rpx;
  781. }
  782. &-num {
  783. display: flex;
  784. align-items: center;
  785. justify-content: space-between;
  786. margin-bottom: 70rpx;
  787. .info-other {
  788. color: #ea4a41;
  789. font-size: 28rpx;
  790. height: 52rpx;
  791. line-height: 52rpx;
  792. padding: 0 10rpx;
  793. border-radius: 8rpx;
  794. background-color: #fff4f3;
  795. }
  796. .info-status {
  797. color: #ffffff;
  798. font-size: 28rpx;
  799. height: 44rpx;
  800. line-height: 44rpx;
  801. padding: 0 14rpx;
  802. background-color: #ffbb01;
  803. border-top-left-radius: 16rpx;
  804. border-bottom-right-radius: 16rpx;
  805. }
  806. }
  807. .bottom {
  808. display: flex;
  809. align-items: center;
  810. justify-content: space-between;
  811. .money {
  812. color: #ea4a41;
  813. font-size: 24rpx;
  814. .spec {
  815. font-size: 40rpx !important;
  816. }
  817. }
  818. .btn {
  819. height: 68rpx;
  820. border-radius: 68rpx;
  821. background: linear-gradient(141deg, #f97c55 0%, #f44545 100%);
  822. line-height: 68rpx;
  823. width: 192rpx;
  824. text-align: center;
  825. color: #ffffff;
  826. font-size: 28rpx;
  827. &.disabled {
  828. background: #f8f8f8 !important;
  829. color: #999999;
  830. }
  831. }
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. .exchange {
  839. // @include page();
  840. .content {
  841. display: flex;
  842. flex-direction: column;
  843. .scroll {
  844. height: 50rpx;
  845. line-height: 50rpx;
  846. background: rgba(250, 99, 66, 0.2);
  847. display: flex;
  848. align-items: center;
  849. color: #fa6342;
  850. text {
  851. font-size: 40rpx;
  852. color: #fa6342;
  853. margin-left: 30rpx;
  854. }
  855. .scroll-wrapper {
  856. flex: 1;
  857. height: 100%;
  858. overflow: hidden;
  859. .scroller {
  860. height: 100%;
  861. white-space: nowrap;
  862. font-size: 26rpx;
  863. padding-left: 10rpx;
  864. animation: scroll-left-right 12s linear infinite;
  865. }
  866. }
  867. }
  868. .banner {
  869. width: 100%;
  870. height: 216rpx;
  871. }
  872. .nav {
  873. height: 76rpx;
  874. box-sizing: border-box;
  875. padding: 0 30rpx;
  876. border-bottom: 6rpx solid #eeeeee;
  877. display: flex;
  878. justify-content: space-between;
  879. align-items: center;
  880. font-size: 32rpx;
  881. view {
  882. height: 100%;
  883. display: flex;
  884. align-items: center;
  885. .cuIcon {
  886. font-size: 40rpx;
  887. margin-right: 12rpx;
  888. }
  889. }
  890. }
  891. .list {
  892. flex: 1;
  893. scroll-view {
  894. box-sizing: border-box;
  895. padding: 0 30rpx 0;
  896. }
  897. }
  898. }
  899. }
  900. @keyframes scroll-left-right {
  901. 0% {
  902. transform: translateX(100%);
  903. }
  904. 100% {
  905. transform: translateX(-100%);
  906. }
  907. }
  908. </style>