myQr.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="box">
  3. <view style="height: 20vh;"></view>
  4. <view class="cont">
  5. <view class="contTop">
  6. <image src="../../static/timg/hl1.png" mode="" class="contTopImg"></image>
  7. <view class="contTopTitle">专属二维码</view>
  8. <image src="../../static/timg/hl2.png" mode="" class="contTopImg"></image>
  9. </view>
  10. <view class="headImgBox">
  11. <image :src="userInfo.headImg" mode="" class="headImg"></image>
  12. </view>
  13. <view class="nickName">{{userInfo.nickName}}</view>
  14. <view class="ms">很不错的店铺 值得推荐!</view>
  15. <view class="wqmBox">
  16. <view class="ewmLeft">
  17. <image :src="img" mode="" class="ewmImg"></image>
  18. </view>
  19. <view class="ewmRight">
  20. <view class="ewmRight1">长按二维码立即关注</view>
  21. <view class="ewmRight2">登记个人信息即可享受新人优惠</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. components: {
  30. },
  31. data() {
  32. return {
  33. headImg: '',
  34. themeColor:'',
  35. userInfo:'',
  36. type:'',
  37. wxOpenData:'',
  38. ext:'',
  39. img:'',
  40. }
  41. },
  42. onLoad(opt) {
  43. this.themeColor = uni.getStorageSync("themeColor");
  44. this.userInfo = uni.getStorageSync("userInfo");
  45. this.wxOpenData=this.$store.state.wxOpenData;
  46. this.ext=this.$common.getExtStoreId();
  47. this.type=opt.type;
  48. //if(this.type==1){
  49. this.openShareQrCode()
  50. //}
  51. },
  52. onShow() {
  53. },
  54. methods: {
  55. openShareQrCode(){
  56. uni.showLoading({
  57. title: '加载中'
  58. })
  59. this.$request.httpBinary('openShareQrCode/create', {
  60. bizType:this.type,
  61. openId:this.wxOpenData.openid,
  62. unionId:this.ext.unionId,
  63. shopId:this.ext.shopId
  64. }, 'GET').then(res => {
  65. uni.hideLoading();
  66. this.img = 'data:image/png;base64,'+uni.arrayBufferToBase64(res);
  67. //this.img= uni.arrayBufferToBase64(res)
  68. //console.log('list+=', this.queryShopList);
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped lang="less">
  75. .box {
  76. width: 100vw;
  77. min-height: 100vh;
  78. background: url('http://dmsphoto.66km.com.cn/thFiles/D3702233-AB0E-415A-95C6-C7835283E8BC.png') no-repeat;
  79. background-size:100% 100% ;
  80. }
  81. .cont{
  82. width: 650rpx;
  83. height: 651rpx;
  84. background: #FFFFFF;
  85. border-radius: 20rpx;
  86. border: 10rpx solid #FFCE11;
  87. margin-left: 50rpx;
  88. }
  89. .contTopImg{
  90. height: 28rpx;width: 155rpx;margin-top: 11rpx;
  91. }
  92. .contTopTitle{
  93. font-size: 36rpx;
  94. font-family: PingFangSC-Medium, PingFang SC;
  95. font-weight: 500;
  96. color: #FFAF18;
  97. line-height: 50rpx;
  98. }
  99. .contTop{
  100. display: flex;
  101. justify-content: space-around;
  102. padding-top: 60rpx;
  103. }
  104. .headImg{
  105. width: 103rpx;height: 103rpx;border-radius: 50%;
  106. }
  107. .headImgBox{
  108. text-align: center;padding-top: 50rpx;
  109. }
  110. .nickName{
  111. color: #999999;font-size: 26rpx;text-align: center;padding-top: 16rpx;
  112. }
  113. .ms{
  114. color: #FFAF18;font-size: 30rpx;padding-top: 16rpx;text-align: center;
  115. }
  116. .wqmBox{
  117. border-top:1px solid #EEEEEE;margin-top: 20rpx;
  118. display: flex;
  119. padding: 30rpx 0 0 30rpx;
  120. }
  121. .ewmImg{
  122. width: 200rpx;
  123. height: 200rpx;
  124. }
  125. .ewmRight1{
  126. color: #999999;font-size: 24rpx;padding-top: 50rpx;padding-left: 24rpx;
  127. }
  128. .ewmRight2{
  129. color: #999999;font-size: 24rpx;padding-top: 16rpx;padding-left: 24rpx;
  130. }
  131. </style>