前端-胡立永 3 weeks ago
parent
commit
72664be9d6
3 changed files with 28 additions and 13 deletions
  1. +1
    -1
      config.js
  2. +1
    -0
      pages/index/index.vue
  3. +26
    -12
      pages/subcomponent/promo-qrcode.vue

+ 1
- 1
config.js View File

@ -1,5 +1,5 @@
// config.js
const type = 'prod'
const type = 'local'
const config = {
local: {


+ 1
- 0
pages/index/index.vue View File

@ -199,6 +199,7 @@
uni.setStorageSync('openid', res.result.userInfo && res.result.userInfo
.appletOpenid);
getApp().globalData.login_status = true;
if (res.result.userInfo) {
const userInfo = res.result.userInfo;
if (!userInfo.headImage || !userInfo.nickName) {


+ 26
- 12
pages/subcomponent/promo-qrcode.vue View File

@ -1,22 +1,24 @@
<template>
<view class="promo-modal-page">
<!-- 顶部导航栏 -->
<view class="nav-bar">
<!-- <view class="nav-bar">
<view class="back" @tap="navigateBack">
<uni-icons type="left" size="20" />
</view>
<text class="title">推广链接</text>
</view>
</view> -->
<navbar title="推广链接" leftClick
@leftClick="$utils.navigateBack" />
<!-- 页面内容 -->
<view class="content">
<!-- 用户信息 -->
<view class="user-info-modal">
<!-- <view class="user-info-modal">
<view class="avatar-frame">
<image class="avatar-img" :src="userInfo.headImage || '/static/avatar.png'" mode="aspectFill" />
</view>
<view class="nickname">{{ userInfo.nickName || '用户' }}</view>
</view>
</view> -->
<!-- 二维码区 -->
<view class="qrcode-modal-section">
<image class="qrcode-img" :src="qrcodeUrl" mode="widthFix" />
@ -33,9 +35,12 @@
<script>
import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
import config from '@/api/config.js'
import config from '@/config.js'
import navbar from '@/compoent/base/navbar.vue'
export default {
components : {
navbar
},
mixins: [pullRefreshMixin],
data() {
return {
@ -97,15 +102,24 @@ export default {
this.qrcodeUrl = getApp().globalData.qr_path
} else {
console.log('全局二维码路径不存在')
uni.showLoading({
title: '拼命绘画中...'
})
uni.getImageInfo({
src: `${config.baseUrl}/recycle-admin/applet/promotion/getInviteCode?token=${uni.getStorageSync('token')}`,
success: res => {
console.log(res);
getApp().globalData.qr_path = res.path
console.log(getApp().globalData.qr_path, 'qr_path')
this.qrcodeUrl = getApp().globalData.qr_path
this.qrcodeUrl = res.path
},
fail: err => {
console.log('QR code load failed:', err)
},
complete() {
uni.hideLoading()
}
})
}
@ -177,9 +191,8 @@ export default {
.promo-modal-page {
min-height: 100vh;
background: #f8f8f8;
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
// padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
overflow: hidden;
height: 100vh;
}
.nav-bar {
@ -211,8 +224,9 @@ export default {
}
.content {
padding: 30rpx 0 0 0;
margin-top: calc(150rpx + var(--status-bar-height) + 80rpx);
// padding: 30rpx 0 0 0;
padding: 20rpx;
// margin-top: calc(150rpx + var(--status-bar-height) + 80rpx);
height: 100%;
display: flex;
flex-direction: column;
@ -252,7 +266,7 @@ export default {
}
.qrcode-modal-section {
width: 300rpx;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;


Loading…
Cancel
Save