前端-胡立永 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 // config.js
const type = 'prod'
const type = 'local'
const config = { const config = {
local: { local: {


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

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


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

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


Loading…
Cancel
Save