Browse Source

二维码样式

remotes/origin/HEAD
songsong428 5 years ago
parent
commit
eec224c6dd
  1. 41
      pages/index/components/home.vue
  2. 16
      pages/index/components/mine.vue

41
pages/index/components/home.vue

@ -3,8 +3,10 @@
<view v-if="healthCode" style="position: relative;"> <view v-if="healthCode" style="position: relative;">
<image src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9joZ6fC6TxFlt9mW4UhUn2PEgUne7OUt4q4mNE.k9gU.rSr8Eu*pFToZoVwUOEGDrKMycDqdn1mLFGE1dxYTGUcE!/b&bo=7gKRAu4CkQIDWXw!&rf=viewer_4&t=5" <image src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9joZ6fC6TxFlt9mW4UhUn2PEgUne7OUt4q4mNE.k9gU.rSr8Eu*pFToZoVwUOEGDrKMycDqdn1mLFGE1dxYTGUcE!/b&bo=7gKRAu4CkQIDWXw!&rf=viewer_4&t=5"
class="bg1"></image> class="bg1"></image>
<view class="bg-code"> <view class="bg-code" @click="getPreviewImg(healthCode)">
<image class="healthy-code" :src="healthCode"></image> <view class="healthy-code-bg shadow-lg">
<image class="healthy-code" :src="healthCode"></image>
</view>
</view> </view>
</view> </view>
<image v-else src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9jhx9v1rh8VuBAojvYxrYvg*uVMAXaD2En3CPiaHx7AWMjFTafVrGxwJR4jZd5s4ProhQT1ceDVquyQR7HVquBKk!/b&bo=7gLuAe4C7gEDORw!&rf=viewer_4&t=5" <image v-else src="http://m.qpic.cn/psc?/V11kyB1O080aC1/cnQ2D7YjAZ5R6pY0fmc9jhx9v1rh8VuBAojvYxrYvg*uVMAXaD2En3CPiaHx7AWMjFTafVrGxwJR4jZd5s4ProhQT1ceDVquyQR7HVquBKk!/b&bo=7gLuAe4C7gEDORw!&rf=viewer_4&t=5"
@ -61,14 +63,27 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import {
mapState
} from 'vuex';
export default { export default {
name: 'Home', name: 'Home',
data() { data() {
return { return {}
}
}, },
computed: mapState('user', ['userInfo','healthCode']), computed: mapState('user', ['userInfo', 'healthCode']),
methods: {
//
getPreviewImg(image) {
var imgArr = [];
imgArr.push(image);
uni.previewImage({
urls: imgArr,
current: imgArr[0]
});
},
}
}; };
</script> </script>
@ -89,11 +104,23 @@
position: absolute; position: absolute;
top: 370rpx; top: 370rpx;
.healthy-code { .healthy-code-bg {
margin: 0 auto; margin: 0 auto;
width: 230rpx; width: 230rpx;
height: 230rpx; height: 230rpx;
border-radius: 10px;
overflow: hidden;
background: $ghostWhite;
.healthy-code {
margin: 5rpx;
width: 220rpx;
height: 220rpx;
border-radius: 10px;
}
} }
} }
.box { .box {

16
pages/index/components/mine.vue

@ -11,7 +11,7 @@
<!-- <view class="text-df padding-top-xs">{{ user.wxInfo.classes }}</view> --> <!-- <view class="text-df padding-top-xs">{{ user.wxInfo.classes }}</view> -->
</view> </view>
<image class="healthy-code" :src="healthCode"></image> <image class="healthy-code" :src="healthCode" @tap="getPreviewImg(healthCode)"></image>
</view> </view>
</view> </view>
<view class="cu-card flex bg-white" v-else> <view class="cu-card flex bg-white" v-else>
@ -65,7 +65,21 @@
}, },
}; };
}, },
computed: mapState('user', ['healthCode', 'user']), computed: mapState('user', ['healthCode', 'user']),
methods: {
//
getPreviewImg(image) {
var imgArr = [];
imgArr.push(image);
uni.previewImage({
urls: imgArr,
current: imgArr[0]
});
},
}
}; };
</script> </script>

Loading…
Cancel
Save