share.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. <template name="share">
  2. <view class="poster_page">
  3. <canvas canvas-id="poster" class="poster_canvas"></canvas>
  4. <swiper class="poster_swiper" previous-margin="110rpx" circular :current="swiperIndex" next-margin="110rpx" @change="onSwiperChange">
  5. <swiper-item v-for="(v, k) of fetch.pic" :key="k">
  6. <view class="goods_info_box" :class="{ active: swiperIndex == k }">
  7. <image class="goods_image" :src="v" mode="aspectFit"></image>
  8. <view class="goods_info">
  9. <view class="goods_name">{{fetch.info.name}}</view>
  10. <view class="price_box">
  11. <view class="price">{{fetch.info.price}}</view>
  12. <view class="store_price">{{fetch.info.s_price}}</view>
  13. </view>
  14. <view class="poster_info">
  15. <view class="info">
  16. <view>长按识别二维码访问</view>
  17. <text>{{fetch.info.platform_name}}</text>
  18. </view>
  19. <image class="poster_code_image" :src="fetch.info.qrcode" mode="aspectFit"></image>
  20. </view>
  21. </view>
  22. </view>
  23. </swiper-item>
  24. </swiper>
  25. <view class="share_save_box">
  26. <!-- #ifdef MP -->
  27. <button open-type="share">
  28. <image src="@/static/demo/ic_pic.png" mode="aspectFit"></image>
  29. <text>发给好友</text>
  30. </button>
  31. <!-- #endif -->
  32. <!-- #ifdef APP-PLUS -->
  33. <button @click="onAppShare">
  34. <image src="@/static/demo/ic_pic.png" mode="aspectFit"></image>
  35. <text>发给好友</text>
  36. </button>
  37. <!-- #endif -->
  38. <button class="onSave" @click="showText">
  39. <view class="lg text-gray cuIcon-formfill" style="width:70rpx;height:70rpx"></view>
  40. <text>文案</text>
  41. </button>
  42. <button class="onSave" @click="showRes">
  43. <view class="lg text-gray cuIcon-picfill" style="width:70rpx;height:70rpx"></view>
  44. <text>素材</text>
  45. </button>
  46. <button class="onSave" @click="showPoster">
  47. <view class="lg text-gray cuIcon-btn" style="width:70rpx;height:70rpx"></view>
  48. <text>海报</text>
  49. </button>
  50. </view>
  51. <!-- #ifdef H5 -->
  52. <graceDialog :isTitle="false" :title="`长按保存海报`" :isCloseBtn="false" :show="image" closeBtnColor="#FFFFFF" v-on:closeDialog="closeImage">
  53. <view class="grace-img-in" slot="content">
  54. <image class="demo-img" :src="poster" mode="widthFix"></image>
  55. </view>
  56. <view slot="btns" class="grace-space-between">
  57. <text class="grace-dialog-buttons" @tap="closeImage">关闭</text>
  58. <text class="grace-dialog-buttons grace-blue" @tap="closeImage">长按复制</text>
  59. </view>
  60. </graceDialog>
  61. <graceDialog :isTitle="true" :title="`复制文案`" :isCloseBtn="false" :show="text" v-on:closeDialog="closeText">
  62. <scroll-view :scroll-y="true" class="content2" slot="content">
  63. <view v-for="(v, k) in fetch.text" :key="k" @click="textClick(k)">
  64. <graceBorderRadius :background="v.background" :radius="['33rpx','33rpx','33rpx','33rpx']">
  65. <text>{{v.content}}</text>
  66. </graceBorderRadius>
  67. </view>
  68. </scroll-view>
  69. <view slot="btns" class="grace-space-between">
  70. <text class="grace-dialog-buttons" @tap="closeText">关闭</text>
  71. <text class="grace-dialog-buttons grace-blue" @tap="textCopy">复制</text>
  72. </view>
  73. </graceDialog>
  74. <graceDialog :isTitle="true" :title="`素材大全`" :isCloseBtn="false" :show="res" v-on:closeDialog="closeRes">
  75. <scroll-view :scroll-y="true" class="content2" slot="content">
  76. <view v-for="(v, k) in fetch.pic" :key="k">
  77. <view class="grace-img-in">
  78. <image class="demo-img" :src="v" mode="widthFix"></image>
  79. </view>
  80. </view>
  81. </scroll-view>
  82. <view slot="btns" class="grace-space-between">
  83. <text class="grace-dialog-buttons" @tap="closeRes">关闭</text>
  84. <text class="grace-dialog-buttons grace-blue" @tap="closeRes">长按复制</text>
  85. </view>
  86. </graceDialog>
  87. <!-- #endif -->
  88. </view>
  89. </template>
  90. <script>
  91. import { mapState, mapMutations } from 'vuex';
  92. let settingWritePhotosAlbum = false;
  93. import copyText from "@/lib/clipboard.thorui.js";
  94. export default {
  95. props: {
  96. content_id : {
  97. type : String,
  98. value : null
  99. },
  100. width : {
  101. type : String,
  102. default : '100%'
  103. },
  104. param : {},
  105. index : 0,
  106. type : 0,
  107. },
  108. data() {
  109. return {
  110. swiperIndex: 0,
  111. posterImgs: [],
  112. poster: "",
  113. image : false,
  114. text : false,
  115. res : false,
  116. text_index : 0,
  117. text_top : 0,
  118. fetch : {
  119. info : {},
  120. pic : [],
  121. text : [],
  122. share: {},
  123. }
  124. };
  125. },
  126. //第一次加载
  127. mounted() {
  128. this.getData();
  129. },
  130. computed: {
  131. },
  132. //方法
  133. methods: {
  134. getData : function() {
  135. var url = this.Dever.host + '/pages/dream/view';
  136. this.Dever.get(this, 'app/collection/?l=api.getShare', {code:this.Dever.config.code,content_id:this.content_id,type:this.type, url:url, index:this.index});
  137. },
  138. getInfo : function() {
  139. },
  140. showImage : function () {
  141. this.image = true;
  142. },
  143. closeImage : function () {
  144. this.image = false;
  145. },
  146. showRes : function () {
  147. this.res = true;
  148. },
  149. closeRes : function () {
  150. this.res = false;
  151. },
  152. showText : function () {
  153. this.text = true;
  154. },
  155. closeText : function () {
  156. this.text = false;
  157. },
  158. textClick : function(index) {
  159. if (index == this.text_index) {
  160. this.fetch.text[this.text_index].background = '#bababa';
  161. this.text_index = -1;
  162. return;
  163. }
  164. this.fetch.text[index].background = '#ffaa00';
  165. if (this.fetch.text[this.text_index]) {
  166. this.fetch.text[this.text_index].background = '#bababa';
  167. }
  168. this.text_index = index;
  169. },
  170. textCopy : function() {
  171. var self = this;
  172. var value = this.fetch.text[this.text_index].content;
  173. copyText.getClipboardData(value, function(res) {
  174. // #ifdef H5
  175. if (res) {
  176. self.Dever.alert('复制成功');
  177. } else {
  178. self.Dever.alert('复制失败');
  179. }
  180. // #endif
  181. });
  182. },
  183. // 轮播图变化
  184. onSwiperChange(e) {
  185. this.swiperIndex = e.detail.current;
  186. },
  187. // 创建海报
  188. createPoster() {
  189. return new Promise((resolve, reject) => {
  190. if (!this.fetch.info.qrcode) {
  191. this.Dever.alert('没有二维码');
  192. return;
  193. }
  194. uni.showLoading({
  195. title: '海报生成中'
  196. });
  197. const ctx = uni.createCanvasContext('poster');
  198. ctx.imageSmoothingEnabled = false;
  199. ctx.fillRect(0, 0, 375, 673);
  200. ctx.setFillStyle("#FFF");
  201. ctx.fillRect(0, 0, 375, 673);
  202. this.downPic(ctx, resolve, reject);
  203. });
  204. },
  205. //下载图片
  206. downPic : function(ctx, resolve, reject) {
  207. var self = this;
  208. uni.downloadFile({
  209. url: self.fetch.pic[self.swiperIndex],
  210. success: (res) => {
  211. if (res.statusCode === 200) {
  212. uni.getImageInfo({
  213. src: res.tempFilePath,
  214. success: function (image) {
  215. var img = self.Dever.getImage(image.width, image.height, 375, 375);
  216. var x = (375 - img[0])/2;
  217. var y = 0;
  218. ctx.drawImage(res.tempFilePath, x, y, img[0], img[1]);
  219. self.downQrcode(ctx, resolve, reject);
  220. }
  221. });
  222. } else {
  223. uni.hideLoading();
  224. self.Dever.alert('海报制作失败,图片下载失败');
  225. }
  226. },
  227. fail: (err) => {
  228. uni.hideLoading();
  229. self.Dever.alert('海报制作失败,图片下载失败');
  230. }
  231. });
  232. },
  233. //下载二维码
  234. downQrcode : function(ctx, resolve, reject) {
  235. uni.downloadFile({
  236. url: this.fetch.info.qrcode,
  237. success: (res) => {
  238. if (res.statusCode === 200) {
  239. this.addPosterName(ctx);
  240. this.addPosterPrice(ctx);
  241. this.addPosterQrcode(ctx);
  242. // 二维码
  243. ctx.drawImage(res.tempFilePath, 238, this.text_top + 88, 120, 120);
  244. this.drawPoster(ctx, resolve, reject);
  245. } else {
  246. uni.hideLoading();
  247. this.Dever.alert('海报制作失败,图片下载失败');
  248. }
  249. },
  250. fail: (err) => {
  251. uni.hideLoading();
  252. this.Dever.alert('海报制作失败,图片下载失败');
  253. }
  254. });
  255. },
  256. // 商品标题
  257. addPosterName : function(ctx) {
  258. ctx.setFontSize(21);
  259. ctx.setFillStyle('#333');
  260. let drawtextList = drawtext(this.fetch.info.name, 341);
  261. this.text_top = 0;
  262. drawtextList.forEach((item,index) => {
  263. if(index < 2){
  264. this.text_top = 380 + (index + 1) * 28;
  265. ctx.fillText(item.content, 17, this.text_top);
  266. }
  267. });
  268. },
  269. // 商品价格
  270. addPosterPrice : function(ctx) {
  271. if (this.fetch.info.price) {
  272. ctx.setFontSize(26);
  273. ctx.setFillStyle('#f00');
  274. ctx.fillText(this.fetch.info.price, 17, this.text_top + 47);
  275. // 商品门市价
  276. ctx.setFontSize(18);
  277. ctx.setFillStyle('#999');
  278. let textLeft = 38 + (this.fetch.info.price.length * 13)
  279. ctx.fillText(this.fetch.info.s_price, textLeft, this.text_top + 45);
  280. // 商品门市价横线
  281. ctx.beginPath();
  282. ctx.setLineWidth(1);
  283. ctx.moveTo(textLeft - 1, this.text_top + 38);
  284. ctx.lineTo((textLeft + 5 + this.fetch.info.s_price.length * 9), this.text_top + 38);
  285. ctx.setStrokeStyle('#999');
  286. ctx.stroke();
  287. }
  288. // 商品分割线
  289. ctx.beginPath();
  290. ctx.setLineWidth(1);
  291. ctx.moveTo(17, this.text_top + 70);
  292. ctx.lineTo(358, this.text_top + 70);
  293. ctx.setStrokeStyle('#eee');
  294. ctx.stroke();
  295. },
  296. //二维码
  297. addPosterQrcode : function(ctx) {
  298. // 长按识别二维码访问
  299. ctx.setFontSize(19);
  300. ctx.setFillStyle('#333');
  301. ctx.fillText("长按识别二维码访问", 17, this.text_top + 136);
  302. // 平台名称
  303. ctx.setFontSize(16);
  304. ctx.setFillStyle('#999');
  305. ctx.fillText(this.fetch.info.platform_name, 17, this.text_top + 170);
  306. },
  307. // 绘制海报
  308. drawPoster : function(ctx, resolve, reject) {
  309. ctx.draw(true, () => {
  310. // canvas画布转成图片并返回图片地址
  311. uni.canvasToTempFilePath({
  312. canvasId: 'poster',
  313. width: 375,
  314. height: 673,
  315. quality : 1,
  316. success: (res) => {
  317. if(this.posterImgs[this.swiperIndex]){
  318. this.posterImgs[this.swiperIndex].temporary = res.tempFilePath;
  319. }else{
  320. this.posterImgs[this.swiperIndex] = {
  321. temporary: res.tempFilePath
  322. };
  323. }
  324. resolve(res.tempFilePath);
  325. },
  326. fail: () => {
  327. uni.hideLoading();
  328. reject();
  329. }
  330. })
  331. });
  332. },
  333. // 保存图片
  334. async showPoster() {
  335. let imgUrl = "";
  336. if(this.posterImgs[this.swiperIndex] && this.posterImgs[this.swiperIndex].temporary){
  337. imgUrl = await this.posterImgs[this.swiperIndex].temporary;
  338. }else{
  339. imgUrl = await this.createPoster();
  340. }
  341. // #ifdef H5
  342. this.poster = imgUrl;
  343. this.showImage();
  344. uni.hideLoading();
  345. // #endif
  346. // #ifdef MP-WEIXIN
  347. uni.showLoading({
  348. title: '海报下载中'
  349. });
  350. if (settingWritePhotosAlbum) {
  351. uni.getSetting({
  352. success: res => {
  353. if (res.authSetting['scope.writePhotosAlbum']) {
  354. uni.saveImageToPhotosAlbum({
  355. filePath: imgUrl,
  356. success: () => {
  357. uni.hideLoading();
  358. uni.showToast({
  359. title: '保存成功'
  360. });
  361. }
  362. });
  363. } else {
  364. uni.showModal({
  365. title: '提示',
  366. content: '请先在设置页面打开“保存相册”使用权限',
  367. confirmText: '去设置',
  368. cancelText: '算了',
  369. success: data => {
  370. if (data.confirm) {
  371. uni.hideLoading();
  372. uni.openSetting();
  373. }
  374. }
  375. });
  376. }
  377. }
  378. });
  379. } else {
  380. settingWritePhotosAlbum = true;
  381. uni.authorize({
  382. scope: 'scope.writePhotosAlbum',
  383. success: () => {
  384. uni.saveImageToPhotosAlbum({
  385. filePath: imgUrl,
  386. success: () => {
  387. uni.hideLoading();
  388. uni.showToast({
  389. title: '保存成功'
  390. });
  391. }
  392. });
  393. }
  394. });
  395. }
  396. // #endif
  397. // #ifdef APP-PLUS
  398. uni.showLoading({
  399. title: '海报下载中'
  400. });
  401. uni.saveImageToPhotosAlbum({
  402. filePath: imgUrl,
  403. success: () => {
  404. uni.hideLoading();
  405. uni.showToast({
  406. title: '保存成功'
  407. });
  408. }
  409. });
  410. // #endif
  411. },
  412. async onAppShare() {
  413. // let imgUrl = "";
  414. // if(this.posterImgs[this.swiperIndex] && this.posterImgs[this.swiperIndex].url){
  415. // imgUrl = this.posterImgs[this.swiperIndex].url;
  416. // } else if(this.posterImgs[this.swiperIndex] && this.posterImgs[this.swiperIndex].temporary){
  417. // let imgData = await this.$http.qnFileUpload([this.posterImgs[this.swiperIndex].temporary]);
  418. // imgUrl = imgData[0];
  419. // }else{
  420. // let data = await this.createPoster();
  421. // let imgData = await this.$http.qnFileUpload([data]);
  422. // imgUrl = imgData[0];
  423. // }
  424. // uni.hideLoading();
  425. this.fetch.share.url = this.Dever.host + '';
  426. uni.share({
  427. provider: 'weixin',
  428. scene: 'WXSceneSession',
  429. type: 0,
  430. title: this.fetch.share.title,
  431. href: this.fetch.share.url,
  432. summary: this.fetch.share.content,
  433. imageUrl: this.fetch.share.pic,
  434. success: function(res) {
  435. console.log('success:' + JSON.stringify(res));
  436. },
  437. fail: function(err) {
  438. console.log('fail:' + JSON.stringify(err));
  439. }
  440. });
  441. }
  442. },
  443. //页面隐藏
  444. onHide() {},
  445. //页面卸载
  446. onUnload() {},
  447. //页面下来刷新
  448. onPullDownRefresh() {},
  449. //页面上拉触底
  450. onReachBottom() {},
  451. //用户点击分享
  452. onShareAppMessage(e) {
  453. let shareInfo = {
  454. path: "/pages/home/shop/goodsDetail?objId="+this.fetch.info.id,
  455. title: this.fetch.share.title,
  456. imageUrl: this.fetch.share.pic
  457. };
  458. if(this.userInfo.token){
  459. shareInfo.path += "&recommendCode=" + this.userInfo.uid;
  460. }
  461. console.log(shareInfo);
  462. return shareInfo;
  463. },
  464. components:{copyText}
  465. };
  466. // 文字换行
  467. function drawtext(text, maxWidth) {
  468. let textArr = text.split("");
  469. let len = textArr.length;
  470. // 上个节点
  471. let previousNode = 0;
  472. // 记录节点宽度
  473. let nodeWidth = 0;
  474. // 文本换行数组
  475. let rowText = [];
  476. // 如果是字母,侧保存长度
  477. let letterWidth = 0;
  478. // 汉字宽度
  479. let chineseWidth = 21;
  480. // otherFont宽度
  481. let otherWidth = 10.5;
  482. for (let i = 0; i < len; i++) {
  483. if (/[\u4e00-\u9fa5]|[\uFE30-\uFFA0]/g.test(textArr[i])) {
  484. if(letterWidth > 0){
  485. if(nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth){
  486. rowText.push({
  487. type: "text",
  488. content: text.substring(previousNode, i)
  489. });
  490. previousNode = i;
  491. nodeWidth = chineseWidth;
  492. letterWidth = 0;
  493. } else {
  494. nodeWidth += chineseWidth + letterWidth * otherWidth;
  495. letterWidth = 0;
  496. }
  497. } else {
  498. if(nodeWidth + chineseWidth > maxWidth){
  499. rowText.push({
  500. type: "text",
  501. content: text.substring(previousNode, i)
  502. });
  503. previousNode = i;
  504. nodeWidth = chineseWidth;
  505. }else{
  506. nodeWidth += chineseWidth;
  507. }
  508. }
  509. } else {
  510. if(/\n/g.test(textArr[i])){
  511. rowText.push({
  512. type: "break",
  513. content: text.substring(previousNode, i)
  514. });
  515. previousNode = i + 1;
  516. nodeWidth = 0;
  517. letterWidth = 0;
  518. }else if(textArr[i] == "\\" && textArr[i + 1] == "n"){
  519. rowText.push({
  520. type: "break",
  521. content: text.substring(previousNode, i)
  522. });
  523. previousNode = i + 2;
  524. nodeWidth = 0;
  525. letterWidth = 0;
  526. }else if(/[a-zA-Z0-9]/g.test(textArr[i])){
  527. letterWidth += 1;
  528. if(nodeWidth + letterWidth * otherWidth > maxWidth){
  529. rowText.push({
  530. type: "text",
  531. content: text.substring(previousNode, i + 1 - letterWidth)
  532. });
  533. previousNode = i + 1 - letterWidth;
  534. nodeWidth = letterWidth * otherWidth;
  535. letterWidth = 0;
  536. }
  537. } else{
  538. if(nodeWidth + otherWidth > maxWidth){
  539. rowText.push({
  540. type: "text",
  541. content: text.substring(previousNode, i)
  542. });
  543. previousNode = i;
  544. nodeWidth = otherWidth;
  545. }else{
  546. nodeWidth += otherWidth;
  547. }
  548. }
  549. }
  550. }
  551. if (previousNode < len) {
  552. rowText.push({
  553. type: "text",
  554. content: text.substring(previousNode, len)
  555. });
  556. }
  557. return rowText;
  558. }
  559. </script>
  560. <style lang="scss" scoped>
  561. .content2 {
  562. padding:30rpx;
  563. line-height:50rpx;
  564. font-size:26rpx;
  565. height:675rpx;
  566. color:#000000;
  567. }
  568. .content2 view{
  569. padding: 15rpx;
  570. }
  571. .content2 .active {
  572. }
  573. .demo-msg {
  574. width:600rpx;
  575. }
  576. .icon-close{}
  577. .poster_page {
  578. }
  579. .onSave:after {
  580. border:0px;
  581. }
  582. .poster_canvas {
  583. width: 750rpx;
  584. height: 1334rpx;
  585. position: fixed;
  586. top: -10000rpx;
  587. left: 0rpx;
  588. }
  589. .poster_swiper {
  590. height: 950rpx;
  591. width: 100%;
  592. swiper-item {
  593. box-sizing: border-box;
  594. display: flex;
  595. align-items: center;
  596. .goods_info_box {
  597. width: 100%;
  598. height: 100%;
  599. transform: scale(0.88);
  600. transition: all 0.4s;
  601. position: relative;
  602. overflow: hidden;
  603. background-color: #FFFFFF;
  604. &.active {
  605. transform: scale(1);
  606. }
  607. .goods_image {
  608. width: 100%;
  609. height: calc(100vw - 220rpx);
  610. }
  611. .goods_info {
  612. padding: 24rpx;
  613. .goods_name {
  614. color: #333;
  615. font-size: 30rpx;
  616. }
  617. .price_box {
  618. margin-top: 24rpx;
  619. display: flex;
  620. align-items: center;
  621. .price {
  622. font-size: 38rpx;
  623. color: red;
  624. }
  625. .store_price {
  626. margin-left: 30rpx;
  627. font-size: 26rpx;
  628. color: #999;
  629. text-decoration: line-through;
  630. }
  631. }
  632. .poster_info {
  633. border-top: 2rpx solid #f1f1f1;
  634. padding-top: 24rpx;
  635. margin-top: 24rpx;
  636. display: flex;
  637. align-items: center;
  638. justify-content: space-between;
  639. .info {
  640. display: flex;
  641. flex-direction: column;
  642. view {
  643. color: #333;
  644. font-size: 28rpx;
  645. }
  646. text {
  647. color: #999;
  648. font-size: 24rpx;
  649. margin-top: 20rpx;
  650. }
  651. }
  652. .poster_code_image {
  653. width: 170rpx;
  654. height: 170rpx;
  655. flex-shrink: 0;
  656. }
  657. }
  658. }
  659. }
  660. }
  661. }
  662. .share_save_box {
  663. position: fixed;
  664. bottom: calc((100vh - 950rpx - 240rpx) / 4);
  665. left: 0;
  666. z-index: 6;
  667. width: 100%;
  668. display: flex;
  669. justify-content: space-around;
  670. button {
  671. display: flex;
  672. flex-direction: column;
  673. align-items: center;
  674. background-color: transparent;
  675. image {
  676. width: 60rpx;
  677. height: 60rpx;
  678. }
  679. text {
  680. font-size: 24rpx;
  681. color: #333333;
  682. }
  683. }
  684. }
  685. .h5_press_save {
  686. background-color: #000;
  687. position: fixed;
  688. top: 0;
  689. left: 0;
  690. width: 100%;
  691. height: 100%;
  692. display: flex;
  693. align-items: center;
  694. z-index: 100;
  695. image {
  696. width: 100%;
  697. }
  698. .download {
  699. font-size: 24rpx;
  700. color: #ffffff;
  701. background-color: rgba(0,0,0,0.5);
  702. display: flex;
  703. align-items: center;
  704. flex-direction: row;
  705. justify-content: center;
  706. position: absolute;
  707. padding: 5rpx 30rpx;
  708. border-radius: 40rpx;
  709. bottom: 30rpx;
  710. left: 50%;
  711. transform: translateX(-50%);
  712. &:before {
  713. content: '';
  714. width: 24rpx;
  715. height: 24rpx;
  716. margin-right: 15rpx;
  717. }
  718. }
  719. }
  720. </style>