myQr.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="box">
  3. <view style="height: 15vh;"></view>
  4. <view class="cont1" v-if="type==1">
  5. <view class="contTOp">
  6. <view class="headImgBox">
  7. <image :src="userInfo.headImg" mode="" class="headImg" v-if="userInfo.headImg"></image>
  8. <image src="../../static/img/icon_me.png" mode="" class="headImg" v-else></image>
  9. </view>
  10. <view class="nickName">{{userInfo.nickName?userInfo.nickName:'微信昵称'}}</view>
  11. </view>
  12. <view class="wqmBox">
  13. <view class="ewmLeft">
  14. <image :src="img" mode="" class="ewmImg"></image>
  15. </view>
  16. <view class="ewmRight">
  17. <view class="ewmRight1">{{wxOpenData.unionName}}</view>
  18. </view>
  19. <view class="contMs1">扫码关注公众号,登记个人信息 即可享受新</view>
  20. </view>
  21. <view class="btnBox">我的专属二维码</view>
  22. </view>
  23. <view class="cont2" v-if="type==2">
  24. <view class="contTOp">
  25. <view class="headImgBox">
  26. <image :src="userInfo.headImg" mode="" class="headImg" v-if="userInfo.headImg"></image>
  27. <image src="../../static/img/icon_me.png" mode="" class="headImg" v-else></image>
  28. </view>
  29. <view class="nickName">{{userInfo.nickName?userInfo.nickName:'微信昵称'}}</view>
  30. </view>
  31. <view class="wqmBox">
  32. <view class="ewmLeft">
  33. <image :src="img" mode="" class="ewmImg"></image>
  34. </view>
  35. <view class="ewmRight">
  36. <view class="ewmRight1">{{wxOpenData.unionName}}</view>
  37. </view>
  38. </view>
  39. <view class="btnBox">我的专属二维码</view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. components: {
  46. },
  47. data() {
  48. return {
  49. headImg: '',
  50. themeColor:'',
  51. userInfo:'',
  52. type:'',
  53. wxOpenData:'',
  54. ext:'',
  55. img:'',
  56. }
  57. },
  58. onLoad(opt) {
  59. this.themeColor = uni.getStorageSync("themeColor");
  60. this.userInfo = uni.getStorageSync("userInfo");
  61. this.wxOpenData=uni.getStorageSync('wxOpenData');
  62. this.ext=this.$common.getExtStoreId();
  63. this.type=opt.type;
  64. //if(this.type==1){
  65. this.openShareQrCode()
  66. //}
  67. },
  68. onShow() {
  69. },
  70. methods: {
  71. openShareQrCode(){
  72. uni.showLoading({
  73. title: '加载中'
  74. })
  75. this.$request.httpBinary('openShareQrCode/create', {
  76. bizType:this.type,
  77. openId:this.wxOpenData.openid,
  78. unionId:this.ext.unionId,
  79. //shopId:this.ext.shopId,
  80. shopId:this.wxOpenData.loginInfo.customerInfo.shopID,
  81. path:'pages/index/index'
  82. }, 'GET').then(res => {
  83. uni.hideLoading();
  84. this.img = 'data:image/png;base64,'+uni.arrayBufferToBase64(res);
  85. //this.img= uni.arrayBufferToBase64(res)
  86. //console.log('list+=', this.queryShopList);
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style scoped lang="less">
  93. .box {
  94. width: 100vw;
  95. min-height: 100vh;
  96. background: url('http://dmsphoto.66km.com.cn/thFiles/344AA01C-5DEB-471E-BF8A-5CB185F71684.png') no-repeat;
  97. background-size:100% 100% ;
  98. }
  99. .cont{
  100. width: 650rpx;
  101. height: 690rpx;
  102. background: #FFFFFF;
  103. border-radius: 20rpx;
  104. border: 10rpx solid #FFCE11;
  105. margin-left: 50rpx;
  106. }
  107. .cont1{
  108. width: 620rpx;
  109. height: 858rpx;
  110. background: url('http://dmsphoto.66km.com.cn/thFiles/02A79FCC-DB9C-41F2-B092-7EFAC54AD631.png') no-repeat;
  111. background-size:100% 100% ;
  112. margin-left: 65rpx;
  113. position: relative;
  114. }
  115. .contMs1{
  116. font-size: 24rpx;
  117. font-family: PingFangSC-Regular, PingFang SC;
  118. font-weight: 400;
  119. color: #999999;
  120. line-height: 40rpx;
  121. text-align: center;
  122. width: 336rpx;
  123. margin: 0 auto;
  124. padding-top: 30rpx;
  125. }
  126. .cont2{
  127. width: 620rpx;
  128. height: 762rpx;
  129. background: url('http://dmsphoto.66km.com.cn/thFiles/EF6764C2-E253-40D8-9027-6F1E86B22666.png') no-repeat;
  130. background-size:100% 100% ;
  131. margin-left: 65rpx;
  132. position: relative;
  133. }
  134. .btnBox{
  135. width: 329rpx;height: 91rpx;
  136. text-align: center;
  137. line-height: 91rpx;
  138. font-size: 28rpx;
  139. font-family: PingFangSC-Medium, PingFang SC;
  140. font-weight: 500;
  141. color: #DC490A;
  142. position: absolute;
  143. bottom: -45rpx;
  144. left: 146rpx;
  145. background: url('http://dmsphoto.66km.com.cn/thFiles/587A56A8-BD06-4396-8EDD-221C4CAC3F5E.png') no-repeat;
  146. background-size:100% 100% ;
  147. }
  148. .contTOp{
  149. display: flex;
  150. }
  151. .headImg{
  152. width: 103rpx;height: 103rpx;border-radius: 50%;
  153. }
  154. .headImgBox{
  155. text-align: center;padding-top: 24rpx;padding-left: 38rpx;
  156. }
  157. .contTopTitle{
  158. font-size: 36rpx;
  159. font-family: PingFangSC-Medium, PingFang SC;
  160. font-weight: 500;
  161. color: #FFAF18;
  162. line-height: 50rpx;
  163. }
  164. .contTop{
  165. display: flex;
  166. justify-content: space-around;
  167. padding-top: 60rpx;
  168. }
  169. .nickName{
  170. color: #333333;font-size: 26rpx;text-align: center;line-height: 146rpx;padding-left: 24rpx;
  171. font-weight: 500;
  172. }
  173. .ms{
  174. color: #FFAF18;font-size: 30rpx;padding-top: 16rpx;text-align: center;
  175. }
  176. .wqmBox{
  177. border-top:1px solid #EEEEEE;
  178. text-align: center;
  179. padding: 23rpx 0 0 0;
  180. margin-left: 18rpx;
  181. margin-right: 18rpx;
  182. }
  183. .ewmImg{
  184. width: 404rpx;
  185. height: 404rpx;
  186. }
  187. .ewmRight1{
  188. color: #666666;font-size: 28rpx;padding-top: 40rpx;
  189. }
  190. .ewmRight2{
  191. color: #999999;font-size: 24rpx;padding-top: 16rpx;padding-left: 24rpx;
  192. }
  193. </style>