Commit e3979ba2 by 李嘉林

样式调整

parent a6b5f40c
......@@ -12,10 +12,17 @@
</div>
<div class="img">
<image
v-if="userInfo.headPortraitUrl"
mode="aspectFill"
:src="userInfo.headPortraitUrl"
alt=""
></image>
<image
v-else
mode="aspectFill"
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/jpeg/9e733736-3e9d-48d1-82a8-96d21ee014df.jpeg"
alt=""
></image>
</div>
</div>
<div class="cell flex">
......@@ -129,7 +136,7 @@ export default {
wx.hideLoading();
if(res.data.ok=='true'){
this.userInfo = res.data.data;
this.userInfo.headPortraitUrl = DFSImg(this.userInfo.headPortraitUrl);
this.userInfo.headPortraitUrl = this.userInfo.headPortraitUrl?DFSImg(this.userInfo.headPortraitUrl) : '';
}
})
},
......@@ -178,7 +185,7 @@ export default {
padding: 16px 16px 16px 0;
margin-left: 16px;
background: #fff;
border-bottom: 1px solid #d8d8d8;
border-bottom: 1px solid #f5f5f5;
.label {
flex-shrink: 0;
p {
......@@ -215,6 +222,7 @@ export default {
width: 80px;
height: 100px;
overflow: hidden;
border: 1px solid #d8d8d8;
image {
width: 100%;
height: 100%;
......
......@@ -17,24 +17,31 @@
alt=""
></image>
</div>
<p>{{userInfo.company}}</p>
<p>{{ userInfo.company }}</p>
</div>
<div class="userImg">
<image
v-if="userInfo.headPortraitUrl"
mode="aspectFill"
:src="userInfo.headPortraitUrl"
alt=""
></image>
</div>
<div class="userName">{{ userInfo.realname }}</div>
<div class="userWork">{{ userInfo.identity }}</div>
<div class="qrCode">
<image
v-else
mode="aspectFill"
:src="qrCode"
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/jpeg/9e733736-3e9d-48d1-82a8-96d21ee014df.jpeg"
alt=""
></image>
</div>
<div class="userName">{{ userInfo.realname }}</div>
<div class="userWork">{{ userInfo.identity }}</div>
<div class="qrCode">
<canvas
class="canvas-code"
canvas-id="myQrcode"
style="background: #fff; width: 154px; height: 154px"
/>
</div>
<div class="time" v-if="updateTime">{{ updateTime }}</div>
</div>
<div class="explain">相约北京系列冬季体育赛事张家口赛区组委会</div>
......@@ -45,7 +52,8 @@
<script type="text/ecmascript-6">
import live from "@/api/live";
import index from "@/api/index";
import { DFSImg } from '@/utils/common.js'
import { DFSImg } from "@/utils/common.js";
import QRCode from "@/utils/weapp-qrcode.js";
export default {
name: "showPassCheck",
data() {
......@@ -53,7 +61,8 @@ export default {
// 十秒更新一次
updateTime: "",
TimeOut: "",
qrCode: '',
qrCode: "",
qrCodeImg: "",
userInfo: {},
};
},
......@@ -67,12 +76,12 @@ export default {
console.log("---onLoad");
},
onShow() {
console.log("---onShow");
this.getQrCode();
this.TimeOut = null;
this.TimeOut = setInterval(() => {
this.getQrCode();
}, 1000 * 10);
console.log("---onShow");
this.init();
},
onHide() {
......@@ -91,17 +100,38 @@ export default {
wx.hideLoading();
if (res.data.ok == "true") {
this.userInfo = res.data.data;
this.userInfo.headPortraitUrl = DFSImg(this.userInfo.headPortraitUrl);
this.userInfo.headPortraitUrl = this.userInfo.headPortraitUrl
? DFSImg(this.userInfo.headPortraitUrl)
: "";
}
});
},
getQrCode() {
index.generatorUniqueCodeByDynamic().then(res=>{
if(res.data.ok == 'true'){
this.qrCode = res.data.data.uniqueCodePhoto;
index.generatorUniqueCodeByDynamic().then((res) => {
if (res.data.ok == "true") {
this.qrCode = res.data.data.uniqueCode;
this.updateTime = res.data.data.createDatetime;
this.getQrcodeImg();
}
})
});
},
getQrcodeImg() {
let _this = this;
const systemInfo = wx.getSystemInfoSync();
const width = (154 * systemInfo.windowWidth) / 375;
const height = width;
new QRCode("myQrcode", {
text: _this.qrCode,
width,
height,
padding: 4, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
callback: (res) => {
console.log(res.path, "---res.path");
_this.qrCodeImg = res.path;
// 接下来就可以直接调用微信小程序的api保存到本地或者将这张二维码直接画在海报上面去,看各自需求
},
});
},
getTime() {
let year = new Date().getFullYear();
......@@ -154,7 +184,7 @@ export default {
.main {
width: 80%;
margin: 0 auto;
margin-top: 40px;
margin-top: 60px;
padding: 10px 12px;
background: #fff;
box-shadow: 0px 6px 24px 8px rgba(0, 0, 0, 0.03),
......@@ -194,7 +224,7 @@ export default {
border: 1px solid #d8d8d8;
padding: 1px;
overflow: hidden;
image{
image {
width: 100%;
height: 100%;
}
......@@ -217,8 +247,8 @@ export default {
width: 154px;
height: 154px;
border: 2px solid #229df1;
padding: 4px;
margin-top: 16px;
overflow: hidden;
}
.time {
margin-top: 14px;
......
......@@ -203,6 +203,7 @@ export default {
let _this = this;
let query = {
customerId: infoData.customerId,
tagInfos: infoData.tagInfos,
handImage: this.idPhoto,
code: this.code,
};
......@@ -358,7 +359,7 @@ export default {
padding: 16px 16px 16px 0;
margin-left: 16px;
background: #fff;
border-bottom: 1px solid #d8d8d8;
border-bottom: 1px solid #f5f5f5;
.label {
flex-shrink: 0;
p {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment