作者 王智

bug

@@ -7,7 +7,8 @@ Page({ @@ -7,7 +7,8 @@ Page({
7 */ 7 */
8 data: { 8 data: {
9 id:'', 9 id:'',
10 - list:'' 10 + list:'',
  11 + shi:''
11 12
12 }, 13 },
13 14
@@ -24,7 +25,10 @@ Page({ @@ -24,7 +25,10 @@ Page({
24 } 25 }
25 app.post(url,d, head).then((res) => { 26 app.post(url,d, head).then((res) => {
26 console.log(res) 27 console.log(res)
  28 + let shi = res.content
  29 + shi = shi.replace(/\<img/gi, '<img style="width:100%;height:auto" ')
27 that.setData({ 30 that.setData({
  31 + shi: shi,
28 list: res 32 list: res
29 }) 33 })
30 34
@@ -33,8 +37,6 @@ Page({ @@ -33,8 +37,6 @@ Page({
33 }) 37 })
34 }, 38 },
35 39
36 -  
37 -  
38 getshengqin(e) { 40 getshengqin(e) {
39 var id =e.currentTarget.dataset.id 41 var id =e.currentTarget.dataset.id
40 console.log(e) 42 console.log(e)
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <view bindtap="getadd">详情介绍</view> 17 <view bindtap="getadd">详情介绍</view>
18 <view class="goods_line"></view> 18 <view class="goods_line"></view>
19 </view> 19 </view>
20 -<rich-text nodes="{{list.content}}"></rich-text> 20 +<rich-text nodes="{{shi}}"></rich-text>
21 21
22 <view class="shengqin"> 22 <view class="shengqin">
23 <button wx:if="{{list.user_status ==0}}">未审核</button> 23 <button wx:if="{{list.user_status ==0}}">未审核</button>
1 -const app =getApp() 1 +const app = getApp()
2 Page({ 2 Page({
3 3
4 /** 4 /**
@@ -6,6 +6,7 @@ Page({ @@ -6,6 +6,7 @@ Page({
6 */ 6 */
7 data: { 7 data: {
8 list: '', 8 list: '',
  9 + active: ''
9 }, 10 },
10 11
11 12
@@ -22,11 +23,11 @@ Page({ @@ -22,11 +23,11 @@ Page({
22 onShow: function () { 23 onShow: function () {
23 24
24 let that = this 25 let that = this
25 - that.getactive() 26 + that.getList()
26 27
27 }, 28 },
28 29
29 - getactive() { 30 + getList() {
30 let that = this; 31 let that = this;
31 let url = '/index/second/zhengJianInfo '; 32 let url = '/index/second/zhengJianInfo ';
32 let head = { 33 let head = {
@@ -45,12 +46,65 @@ Page({ @@ -45,12 +46,65 @@ Page({
45 }, 46 },
46 47
47 48
  49 + // 生成图片
  50 + getPic(e) {
  51 + console.log(e)
  52 + var type = e.currentTarget.dataset.type
  53 + let that = this;
  54 + let url = '/index/second/zhengJianPic ';
  55 + let head = {
  56 + 'XX-Token': wx.getStorageSync('token')
  57 + }
  58 + let params = {
  59 + type: type
  60 + }
48 61
  62 + app.post(url, params, head).then((res) => {
  63 + console.log(res)
  64 + // this.setData({
  65 + // active: res.url
  66 + // })
  67 + wx.downloadFile({
  68 + url: res.url,
  69 + success: (res) => {
  70 + wx.saveImageToPhotosAlbum({
  71 + filePath: res.tempFilePath,
  72 + success: (r) => {
  73 + wx.showToast({
  74 + title: '保存成功',
  75 + mask: true,
  76 + duration: 1000
  77 + })
  78 + }
  79 + })
  80 + }
  81 + })
49 82
50 83
51 84
52 85
  86 + })
  87 + },
53 88
  89 + //保存海报到本地
  90 + // save_poster() {
  91 + // wx.downloadFile({
  92 + // url: this.data.active,
  93 + // success: (res) => {
  94 + // wx.saveImageToPhotosAlbum({
  95 + // filePath: res.tempFilePath,
  96 + // success: (r) => {
  97 + // wx.showToast({
  98 + // title: '保存成功',
  99 + // mask: true,
  100 + // duration: 1000
  101 + // })
  102 + // }
  103 + // })
  104 + // }
  105 + // })
  106 +
  107 + // },
54 108
55 109
56 110
1 <!-- 电子证件 --> 1 <!-- 电子证件 -->
2 <view class="mycertificate"> 2 <view class="mycertificate">
3 - <image src="/imgs/dianzizhengjian1.png"></image> 3 + <image wx:if="{{list.status=='志愿者(待学习)'}}" src="http://volunteer.w.bronet.cn/imgs/idcard2.png"></image>
  4 + <image wx:else src="/imgs/dianzizhengjian1.png"></image>
4 <view class="mycertificate_text"> 5 <view class="mycertificate_text">
5 <view class="goods_left"> 6 <view class="goods_left">
6 <view>姓名:{{list.name}}</view> 7 <view>姓名:{{list.name}}</view>
@@ -13,7 +14,9 @@ @@ -13,7 +14,9 @@
13 14
14 </view> 15 </view>
15 <view class="mycertificate distance"> 16 <view class="mycertificate distance">
16 - <image src="/imgs/dianzizhengjian.png"></image> 17 + <image wx:if="{{list.status=='志愿者(待学习)'}}" src="http://volunteer.w.bronet.cn/imgs/idcard1.png"></image>
  18 + <image wx:else src="/imgs/dianzizhengjian.png"></image>
  19 +
17 <view class="mycertificate_text"> 20 <view class="mycertificate_text">
18 <view class="goods_lefts"> 21 <view class="goods_lefts">
19 <image class="logo" src="https://ftp.bmp.ovh/imgs/2020/10/6ce74d64f7aa1e53.png"></image> 22 <image class="logo" src="https://ftp.bmp.ovh/imgs/2020/10/6ce74d64f7aa1e53.png"></image>
@@ -34,6 +37,8 @@ @@ -34,6 +37,8 @@
34 <view class="good_typeface">4. 如实体证件丢失请及时联系白求恩志愿者中心补办</view> 37 <view class="good_typeface">4. 如实体证件丢失请及时联系白求恩志愿者中心补办</view>
35 </view> 38 </view>
36 39
37 -<view class="btn">  
38 - <button hover-class="none"> 将电子证件生成图片</button> 40 +<view class="btn" wx:if="{{list.status!=='志愿者(待学习)'}}">
  41 + <!-- <button hover-class="none"> 将电子证件生成图片</button> -->
  42 + <view class="generate" bindtap="getPic" data-type="{{1}}">生成正面图片</view>
  43 + <view class="generate" bindtap="getPic" data-type="{{2}}">生成背面图片</view>
39 </view> 44 </view>
@@ -9,8 +9,9 @@ page { @@ -9,8 +9,9 @@ page {
9 position: relative; 9 position: relative;
10 10
11 } 11 }
12 -.distance{  
13 -margin-bottom: 142rpx; 12 +
  13 +.distance {
  14 + margin-bottom: 260rpx;
14 } 15 }
15 16
16 image { 17 image {
@@ -29,7 +30,6 @@ image { @@ -29,7 +30,6 @@ image {
29 left: 0; 30 left: 0;
30 top: 0; 31 top: 0;
31 display: flex; 32 display: flex;
32 -  
33 justify-content: space-between; 33 justify-content: space-between;
34 34
35 35
@@ -95,22 +95,26 @@ image { @@ -95,22 +95,26 @@ image {
95 } 95 }
96 96
97 .btn { 97 .btn {
98 -  
99 - height: 122rpx; 98 + padding-top: 21rpx;
  99 + height: 240rpx;
100 background-color: #ffffff; 100 background-color: #ffffff;
101 - display: flex;  
102 - align-items: center; 101 + box-sizing: border-box;
  102 + /* display: flex; */
  103 + /* align-items: center; */
103 position: fixed; 104 position: fixed;
104 left: 0; 105 left: 0;
105 right: 0; 106 right: 0;
106 bottom: 0; 107 bottom: 0;
107 } 108 }
108 109
109 -button {  
110 - width: 622rpx; 110 +.generate {
  111 + margin-bottom: 21rpx;
  112 + width: 100%;
111 height: 88rpx; 113 height: 88rpx;
  114 + text-align: center;
  115 + line-height: 88rpx;
112 background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%); 116 background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%);
113 - border-radius: 44px; 117 + /* border-radius: 44px; */
114 color: #ffffff; 118 color: #ffffff;
115 - box-shadow: 0px 18px 38px 0px rgba(0, 116, 45, 0.42); 119 + /* box-shadow: 0px 18px 38px 0px rgba(0, 116, 45, 0.42); */
116 } 120 }
@@ -31,7 +31,6 @@ page { @@ -31,7 +31,6 @@ page {
31 .navbar .item.choose { 31 .navbar .item.choose {
32 color: black; 32 color: black;
33 /* background: linear-gradient(136deg, #4e8fff 2%, #55c2fa); */ 33 /* background: linear-gradient(136deg, #4e8fff 2%, #55c2fa); */
34 -  
35 } 34 }
36 35
37 .navbar .item.choose:after { 36 .navbar .item.choose:after {
@@ -79,16 +78,16 @@ page { @@ -79,16 +78,16 @@ page {
79 color: #323233; 78 color: #323233;
80 line-height: 40rpx; 79 line-height: 40rpx;
81 } 80 }
82 -.list_real{ 81 +
  82 +.list_real {
83 height: 80rpx; 83 height: 80rpx;
84 font-size: 28rpx; 84 font-size: 28rpx;
85 font-family: PingFangSC, PingFangSC-Regular; 85 font-family: PingFangSC, PingFangSC-Regular;
86 font-weight: 400; 86 font-weight: 400;
87 -  
88 -  
89 -color: #7D7E80; 87 + color: #7D7E80;
90 } 88 }
91 -.list_status{ 89 +
  90 +.list_status {
92 text-align: right; 91 text-align: right;
93 color: #21AE58; 92 color: #21AE58;
94 font-size: 32rpx; 93 font-size: 32rpx;