Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5
17
App.vue
@@ -1,7 +1,19 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
|
||||
handleFontSize();
|
||||
} else {
|
||||
document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
|
||||
}
|
||||
function handleFontSize() {
|
||||
// 设置网页字体为默认大小
|
||||
WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
|
||||
// 重写设置网页字体大小的事件
|
||||
WeixinJSBridge.on('menu:setfont', function() {
|
||||
WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
@@ -15,9 +27,10 @@
|
||||
<style>
|
||||
page{
|
||||
background: #F5F5F5;
|
||||
-webkit-text-size-adjust: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
@import "uview-ui/index.scss";
|
||||
@import "uview-ui/index.scss";
|
||||
</style>
|
||||
|
||||
@@ -9,11 +9,10 @@ import store from '@/store'
|
||||
|
||||
// 基础配置
|
||||
const config = {
|
||||
// apiUrl : 'https://oapi.lianshang.vip/api/',
|
||||
// apiUrls : 'https://oapi.lianshang.vip/',
|
||||
|
||||
apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
|
||||
apiUrls : 'http://api.ahxh.shangkelian.cn/',
|
||||
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
|
||||
// apiUrls : 'http://api.ahxh.shangkelian.cn/',
|
||||
timeout : 60000
|
||||
}
|
||||
|
||||
@@ -34,9 +33,6 @@ const request = (parameter) => {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': store.getters.getToken || ''
|
||||
}
|
||||
|
||||
// console.log('parameterDbug', parameter)
|
||||
|
||||
// 加载提示
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
|
||||
@@ -25,9 +25,10 @@ const vipOrder = (id, data) =>{
|
||||
}
|
||||
|
||||
// 开通会员微信支付
|
||||
const vipWechatPay = id => {
|
||||
const vipWechatPay = (id, data) => {
|
||||
return request({
|
||||
url : 'user/identities/pay/' + id + '/wechat'
|
||||
url: 'user/identities/pay/' + id + '/wechat',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,32 @@
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 微信配置信息
|
||||
const wxConfig = data => {
|
||||
return request({
|
||||
url : 'user/auth/get_jssdk',
|
||||
data : data
|
||||
url: 'user/auth/get_jssdk',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 鉴权转跳地址
|
||||
const wxCode = data => {
|
||||
return request({
|
||||
url: 'user/auth/get_auth_url',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取openid
|
||||
const wxOpenid = data => {
|
||||
return request({
|
||||
url: 'user/auth/get_openid',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
wxConfig
|
||||
wxConfig,
|
||||
wxCode,
|
||||
wxOpenid
|
||||
}
|
||||
|
||||
18
js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export default function h5Copy(content) {
|
||||
|
||||
if (!document.queryCommandSupported('copy')) {
|
||||
// 不支持
|
||||
return false
|
||||
}
|
||||
|
||||
let textarea = document.createElement("textarea")
|
||||
textarea.value = content
|
||||
textarea.readOnly = "readOnly"
|
||||
document.body.appendChild(textarea)
|
||||
textarea.select() // 选择对象
|
||||
textarea.setSelectionRange(0, content.length) //核心
|
||||
let result = document.execCommand("copy") // 执行浏览器复制命令
|
||||
textarea.remove()
|
||||
return result
|
||||
|
||||
}
|
||||
@@ -332,8 +332,12 @@
|
||||
},
|
||||
"name": "withdrawList",
|
||||
"aliasPath": "/wallet/withdraw/list"
|
||||
}
|
||||
],
|
||||
}, {
|
||||
"path" : "pages/wxAuth/wxAuth",
|
||||
"name" : "wxAuth",
|
||||
"aliasPath": "/wechat-auth"
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#F5F5F5"
|
||||
|
||||
@@ -321,6 +321,8 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: -50rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
.signBtn-go {
|
||||
width: 100%;
|
||||
line-height: 100rpx;
|
||||
|
||||
@@ -57,9 +57,6 @@
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
|
||||
console.log(this.$Route)
|
||||
|
||||
this.parentId = this.$Route.query.invite || ''
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -1,50 +1,33 @@
|
||||
<template>
|
||||
<!-- v-if="loaded" -->
|
||||
<view class="content">
|
||||
<view class="content" v-if="loaded">
|
||||
<view class="code">
|
||||
<swiper class="code-swiper" previous-margin="70rpx" next-margin="70rpx">
|
||||
<swiper-item>
|
||||
<swiper class="code-swiper" previous-margin="70rpx" next-margin="70rpx" @change="swiperChange">
|
||||
<swiper-item v-for="(item, index) in inviteData" :key="index">
|
||||
<view class="code-item">
|
||||
<image class="code-back-image" src="@/static/dev/WechatIMG9663.png" mode="aspectFill"></image>
|
||||
<image class="code-back-image" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="codDate">
|
||||
<view class="codDate-year">
|
||||
2020.09
|
||||
{{item.date.solar.month}}
|
||||
</view>
|
||||
<view class="codDate-day">
|
||||
02
|
||||
{{item.date.solar.day}}
|
||||
</view>
|
||||
<view class="codDate-lunar">
|
||||
农历八月二十
|
||||
{{item.date.lunar}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="codeCont">
|
||||
<image class="codeCont-avatar" src="@/static/user/user-portrait.png" mode="aspectFill"></image>
|
||||
<image class="codeCont-avatar" :src="item.user_info.avatar ? item.user_info.avatar : '/static/user/user-portrait.png'" mode="aspectFill"></image>
|
||||
<view class="codeCont-text">
|
||||
<view class="codeCont-name">
|
||||
唐明明
|
||||
{{item.user_info.nickname}}
|
||||
</view>
|
||||
<view class="codeCont-number">
|
||||
邀请码:
|
||||
<view class="codeBack-number" @click="copyCenter(inviteData.invite)">
|
||||
21321321
|
||||
</view>
|
||||
邀请码:{{item.invite}}
|
||||
</view>
|
||||
</view>
|
||||
<image class="codeCont-img" :src="item.code" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="codeImg">
|
||||
<image class="codeImg-code" mode="widthFix"></image>
|
||||
<view class="codeImg-name">长按识别</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<view class="code-item">
|
||||
<image class="code-back-image" src="@/static/dev/WechatIMG9663.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<view class="code-item">
|
||||
<image class="code-back-image" src="@/static/dev/WechatIMG9663.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@@ -52,37 +35,56 @@
|
||||
<view class="footer">
|
||||
<view class="hith">朋友通过你的邀请注册成功后,将与您绑定好友关系通过成为平台用户,你都可以获得能量碎片奖励。</view>
|
||||
<view class="number">
|
||||
<view class="title">邀请码</view>
|
||||
<view class="value">2173978217389729</view>
|
||||
</view>
|
||||
<view class="button">
|
||||
<view class="title" @click="coverCode">生成分享海报</view>
|
||||
<view class="title">邀请码 : {{inviteData[0].invite}}</view>
|
||||
<view class="value" @click="copyCenter(inviteData[0].invite)">复制邀请码</view>
|
||||
</view>
|
||||
<view class="button" @click="coverCode">生成分享海报</view>
|
||||
</view>
|
||||
<canvas canvas-id="myCanvas"></canvas>
|
||||
<canvas class="my-canvas" canvas-id="myCanvas" id="myCanvas"/>
|
||||
<view v-if="posterShow">
|
||||
<view class="posterBack"></view>
|
||||
<view class="poster">
|
||||
<view class="poster-img">
|
||||
<image class="img" :src="posterImg" mode="widthFix" />
|
||||
</view>
|
||||
<view class="poster-btn">
|
||||
<view class="operate">长按图片保存</view>
|
||||
<view class="operate operate-cancel" @tap="posterShow = false">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { userInvite } from '@/apis/interfaces/user'
|
||||
import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
|
||||
import { saveImageToPhotosAlbum, showToast, downloadFile } from '@/uni_modules/sakura-canvas/js_sdk/util'
|
||||
import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
|
||||
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
|
||||
let draw = null
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inviteData: {} ,//二维码信息
|
||||
loaded : false
|
||||
Popinvite : {}, //下载海报数据
|
||||
inviteData: [] ,//二维码信息
|
||||
codeIndex : 0,
|
||||
posterImg : '',
|
||||
defaultImg: '/static/dev/WechatIMG9663.png',
|
||||
loaded : false,
|
||||
posterShow: false
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 获取二维码
|
||||
// this.inviteInfo()
|
||||
this.inviteInfo()
|
||||
},
|
||||
async created() {},
|
||||
methods:{
|
||||
// 二维码
|
||||
inviteInfo(){
|
||||
userInvite().then(res => {
|
||||
this.inviteData = res
|
||||
this.loaded = true
|
||||
this.inviteData = res
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -90,44 +92,201 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 生成海报
|
||||
coverCode(){
|
||||
let canvas = new Draw({
|
||||
width: '375',
|
||||
height: '745',
|
||||
canvasId: 'myCanvas',
|
||||
_this: this,
|
||||
background: {
|
||||
type: 'color',
|
||||
color: '#fffff'
|
||||
},
|
||||
quality: 1, // 导出图片的质量, 默认1 值范围0~1, 大于一都为1处理
|
||||
drawTipsText: '绘制中...'
|
||||
})
|
||||
// await draw.createdSharePoster(() => {
|
||||
|
||||
// return textArray
|
||||
// })
|
||||
async coverCode(){
|
||||
// let { img, title, price, head, tips } = this
|
||||
let img = this.inviteData[this.codeIndex].code
|
||||
let back = this.inviteData[this.codeIndex].cover
|
||||
let name = this.inviteData[this.codeIndex].user_info.nickname
|
||||
let invite = this.inviteData[this.codeIndex].invite
|
||||
let avatar = this.inviteData[this.codeIndex].user_info.avatar || '/static/user/user-portrait.png'
|
||||
let date = this.inviteData[this.codeIndex].date
|
||||
draw = new Draw({
|
||||
width: 375,
|
||||
height: 745,
|
||||
canvasId:'myCanvas',
|
||||
_this: this,
|
||||
background: {
|
||||
type: 'color',
|
||||
color: 'white',
|
||||
w: 375,
|
||||
h: 745,
|
||||
},
|
||||
})
|
||||
let res = await draw.createdSharePoster(({ bgObj }) => {
|
||||
let { width, height } = bgObj
|
||||
this.Popinvite = bgObj
|
||||
// 绘制内容
|
||||
return [
|
||||
// 背景
|
||||
{
|
||||
type: 'image',
|
||||
x: 0,
|
||||
y: 0,
|
||||
src: back,
|
||||
w: 375,
|
||||
h: 745,
|
||||
zIndex: 0,
|
||||
},
|
||||
|
||||
// 日历-边框
|
||||
{
|
||||
type: 'rect',
|
||||
x: 280,
|
||||
y: 20,
|
||||
w: 60, // 宽度 必填
|
||||
h: 80, // 高度 必填
|
||||
zIndex: 99,
|
||||
isFill: false, // 是否是填充矩形, false: 线性矩形
|
||||
lineWidth: 1 ,// 当矩形为线性时,矩形的边框宽度
|
||||
color: '#ffffff',
|
||||
},
|
||||
|
||||
// 日历-线条
|
||||
{
|
||||
type: 'line',
|
||||
zIndex: 99,
|
||||
x: 280,
|
||||
y: 74,
|
||||
w: 60, // 宽度 默认整个画布的宽度 - x轴的距离
|
||||
color: '#ffffff', // 颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
|
||||
alpha: 1, // 透明度 默认1 取值范围 0~1
|
||||
lineType: 'solid', // 线条类型 默认 solid: 实线 可选 dashed: 虚线
|
||||
lineWidth: 1, // 线条高度
|
||||
lineCap: 'butt' // 线条端点样式 默认 butt 可选 round, square
|
||||
},
|
||||
|
||||
// 日历-年月
|
||||
{
|
||||
type: 'text',
|
||||
x: 284,
|
||||
y: 28,
|
||||
zIndex: 99,
|
||||
w: width - (20 * 2),
|
||||
text: date.solar.month,
|
||||
color: '#ffffff',
|
||||
font: {
|
||||
size: 14
|
||||
}
|
||||
},
|
||||
|
||||
// 日历-日
|
||||
{
|
||||
type: 'text',
|
||||
x: 296,
|
||||
y: 50,
|
||||
zIndex: 99,
|
||||
w: width - (20 * 2),
|
||||
text: date.solar.day,
|
||||
color: '#ffffff',
|
||||
font: {
|
||||
size: 20,
|
||||
weight: 'bold'
|
||||
}
|
||||
},
|
||||
|
||||
// 日历-农历日期
|
||||
{
|
||||
type: 'text',
|
||||
x: 282,
|
||||
y: 80,
|
||||
zIndex: 99,
|
||||
w: width - (20 * 2),
|
||||
text: date.lunar,
|
||||
color: '#ffffff',
|
||||
font: {
|
||||
size: 14
|
||||
}
|
||||
},
|
||||
|
||||
// 用户昵称
|
||||
{
|
||||
type: 'text',
|
||||
x: 90,
|
||||
y: 650,
|
||||
zIndex: 99,
|
||||
w: width - (20 * 2),
|
||||
text: name,
|
||||
color: '#ffffff',
|
||||
font: {
|
||||
size: 18
|
||||
}
|
||||
},
|
||||
|
||||
// 邀请码
|
||||
{
|
||||
type: 'text',
|
||||
x: 90,
|
||||
y: 685,
|
||||
zIndex: 99,
|
||||
w: width - (20 * 2),
|
||||
text: '邀请码:' + invite,
|
||||
color: '#c4a1cb',
|
||||
font: {
|
||||
size: 16
|
||||
}
|
||||
},
|
||||
|
||||
// 用户头像
|
||||
{
|
||||
type: 'image',
|
||||
x: 20,
|
||||
y: 650,
|
||||
src: avatar,
|
||||
w: 54,
|
||||
h: 54,
|
||||
drawType: 'arc',
|
||||
zIndex: 99,
|
||||
borderWidth: 5, // 图片边框大小 默认0
|
||||
borderColor: '#ffffff' // 图片边框颜色 默认无颜色
|
||||
},
|
||||
|
||||
// 二维码
|
||||
{
|
||||
type: 'image',
|
||||
x: 270,
|
||||
y: 630,
|
||||
w: 90,
|
||||
h: 90,
|
||||
zIndex: 99,
|
||||
src: img
|
||||
}
|
||||
]
|
||||
})
|
||||
if (!res.success) return
|
||||
this.posterImg = res.data
|
||||
this.posterShow = true
|
||||
},
|
||||
|
||||
// 保存图片
|
||||
async saveImage() {
|
||||
let { posterImg } = this
|
||||
let res = await saveImageToPhotosAlbum(posterImg)
|
||||
if (!res.success) return
|
||||
showToast('保存成功')
|
||||
this.posterShow = false
|
||||
},
|
||||
|
||||
// 复制邀请码
|
||||
copyCenter(e) {
|
||||
let copyNo = e
|
||||
uni.vibrateShort({
|
||||
success: () => {
|
||||
uni.setClipboardData({
|
||||
data : copyNo,
|
||||
success : res=> {
|
||||
uni.showToast({
|
||||
title : '复制成功',
|
||||
icon :'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
const result = h5Copy(copyNo)
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title:'不支持',
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:'复制成功',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 切换海报背景index
|
||||
swiperChange(e) {
|
||||
this.codeIndex = e.detail.current
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +296,7 @@
|
||||
.content{
|
||||
background: white;
|
||||
padding: $padding 0;
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
@extend .vertical;
|
||||
}
|
||||
@@ -165,12 +325,37 @@
|
||||
|
||||
// 提示信息
|
||||
.footer{
|
||||
padding: $padding ($padding*2);
|
||||
text-align: center;
|
||||
padding: 0 $padding + 10;
|
||||
.hith{
|
||||
color: $text-gray;
|
||||
font-size: $title-size-sm;
|
||||
padding-top: $padding + 10;
|
||||
}
|
||||
.number {
|
||||
background-color: $border-color-lg;
|
||||
padding: $padding - 5;
|
||||
margin: $margin + 20 0;
|
||||
font-size: $title-size-lg;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
.title {
|
||||
flex: 1;
|
||||
}
|
||||
.value {
|
||||
font-size: $title-size-m;
|
||||
color: $text-price;
|
||||
}
|
||||
}
|
||||
.button {
|
||||
background: $mian-color-deep;
|
||||
border-radius: 0;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size;
|
||||
color: white;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
// number
|
||||
// title
|
||||
// value
|
||||
@@ -182,37 +367,43 @@
|
||||
.codeCont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 140rpx;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
bottom: 100rpx;
|
||||
left: 0;
|
||||
padding: 40rpx;
|
||||
padding: 10rpx 30rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
z-index: 9;
|
||||
.codeCont-avatar {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
border: 4rpx solid #FFFFFF;
|
||||
}
|
||||
.codeCont-text {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 50rpx 40rpx 0 180rpx;
|
||||
padding: 10rpx 40rpx 0 150rpx;
|
||||
box-sizing: border-box;
|
||||
.codeCont-name {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
font-size: $title-size;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.codeCont-number {
|
||||
font-size: 28rpx;
|
||||
font-size: $title-size-sm;
|
||||
display: flex;
|
||||
color: #c4a1cb;
|
||||
}
|
||||
}
|
||||
.codeCont-img {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
// 日历
|
||||
.codDate {
|
||||
@@ -235,8 +426,63 @@
|
||||
}
|
||||
.codDate-lunar {
|
||||
font-size: 24rpx;
|
||||
transform: scale(.8);
|
||||
transform: scale(.9);
|
||||
padding: 4rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
// canvas
|
||||
.my-canvas{
|
||||
width: 375px;
|
||||
height: 745px;
|
||||
position: fixed;
|
||||
top: -99999999999rpx;
|
||||
left: -99999999999rpx;
|
||||
z-index: -99999999999;
|
||||
opacity: 0;
|
||||
}
|
||||
.posterBack {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
background-color: rgba(0,0,0,.7);
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.poster{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
&-img{
|
||||
width: 580rpx;
|
||||
position: relative;
|
||||
margin: 70rpx auto 20rpx;
|
||||
.img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
&-btn{
|
||||
padding: 0 $padding * 2;
|
||||
.operate {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
&-cancel{
|
||||
background-color: $text-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<!-- 消息列表弹出 end -->
|
||||
|
||||
<!-- 用户信息 start -->
|
||||
<view class="fileTool" :class="{ bigTool: scroll > 200 }">
|
||||
<!-- <view class="fileTool" :class="{ bigTool: scroll > 200 }">
|
||||
<view class="user-portrait">
|
||||
<image class="user-portrait-head" :src="userData.avatar ? userData.avatar : '/static/user/user-portrait.png'" mode="aspectFill"></image>
|
||||
</view>
|
||||
@@ -39,7 +39,7 @@
|
||||
<image class="user-tool-icon" src="/static/user/user-top-00.png" mode="aspectFill" @click="$Router.push({name: 'setting'})"></image>
|
||||
<image class="user-tool-icon" src="/static/user/user-top-01.png" mode="aspectFill" @click="$Router.push({name: 'news'})"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="user-top" :class="[scroll > 0 ? 'bigTop' : 'refurnTop']">
|
||||
<!-- <image class="user-back" :class="[scroll > 0 ? 'bigSize' : 'refurnSize']" src="../../static/img/user-back.png" mode="aspectFill"></image> -->
|
||||
<view class="user-tool">
|
||||
@@ -252,6 +252,7 @@
|
||||
|
||||
<script>
|
||||
import { userIndex, userNotice, userCustomer } from '@/apis/interfaces/user'
|
||||
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -355,20 +356,17 @@
|
||||
// 复制邀请码
|
||||
copyCenter(e) {
|
||||
let copyNo = e
|
||||
uni.vibrateShort({
|
||||
success: () => {
|
||||
uni.setClipboardData({
|
||||
data : copyNo,
|
||||
success : res=> {
|
||||
uni.showToast({
|
||||
title : '复制成功',
|
||||
icon :'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
const result = h5Copy(copyNo)
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title:'不支持',
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:'复制成功',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 友情提示信息
|
||||
|
||||
1313
pages/vip/vip.vue
46
pages/wxAuth/wxAuth.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<view class="content vertical">
|
||||
<u-loading mode="flower"></u-loading>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { wxCode, wxOpenid } from '@/apis/interfaces/wx'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 微信鉴权
|
||||
if(!this.$Route.query.code){
|
||||
wxCode({
|
||||
pages: 'wechat-auth'
|
||||
}).then(res => {
|
||||
window.location.href = res
|
||||
})
|
||||
}else{
|
||||
wxOpenid({
|
||||
code: this.$Route.query.code
|
||||
}).then(res => {
|
||||
this.$store.commit('setCode', res.openid)
|
||||
this.$Router.replaceAll({name: 'Index'})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background: white;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -28,6 +28,12 @@ const router = createRouter({
|
||||
// 全局路由前置守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
const token = store.getters.getToken || uni.getStorageSync('token')
|
||||
// 检查是否需要微信授权
|
||||
if(store.getters.getCode === '' && to.name != 'wxAuth'){
|
||||
next({
|
||||
name: 'wxAuth'
|
||||
})
|
||||
}
|
||||
// 检查是否需要登录
|
||||
if(to.auth && token === ''){
|
||||
next({
|
||||
|
||||
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 114 KiB |
BIN
static/dev/wallet-code.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -13,6 +13,7 @@ Vue.use(Vuex)
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
token : uni.getStorageSync('token') || '',
|
||||
code : uni.getStorageSync('wxCode') || '',
|
||||
coupongoods : []
|
||||
},
|
||||
getters: {
|
||||
@@ -21,6 +22,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
getCoupongoods: state => {
|
||||
return state.coupongoods
|
||||
},
|
||||
getCode: state => {
|
||||
return state.code
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@@ -30,6 +34,10 @@ export default new Vuex.Store({
|
||||
},
|
||||
setCoupongoods(state, value) {
|
||||
state.coupongoods = value
|
||||
},
|
||||
setCode(state, value) {
|
||||
state.code = value
|
||||
uni.setStorageSync('wxCode', value)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
2
unpackage/dist/build/h5/index.html
vendored
@@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>链商星球</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.f4fc78fe.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.1319762c.js></script><script src=/static/js/index.21bb54d6.js></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.5e7e3b56.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.61332aa4.js></script><script src=/static/js/index.21d43ced.js></script></body></html>
|
||||
BIN
unpackage/dist/build/h5/static/404/404.png
vendored
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 465 KiB After Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 8.0 KiB |
BIN
unpackage/dist/build/h5/static/dev/WechatIMG9663.png
vendored
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
unpackage/dist/build/h5/static/dev/WechatIMG9664.png
vendored
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
unpackage/dist/build/h5/static/dev/WechatIMG9666.png
vendored
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
unpackage/dist/build/h5/static/icons/add-icon.png
vendored
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
unpackage/dist/build/h5/static/icons/audit-icon.png
vendored
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 639 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 285 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 472 B |
BIN
unpackage/dist/build/h5/static/icons/equity_nav.png
vendored
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
unpackage/dist/build/h5/static/icons/fire.png
vendored
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
unpackage/dist/build/h5/static/icons/goods_buy.png
vendored
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 354 B |
BIN
unpackage/dist/build/h5/static/icons/goods_close.png
vendored
|
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 227 B |
BIN
unpackage/dist/build/h5/static/icons/goods_row.png
vendored
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 240 B |
BIN
unpackage/dist/build/h5/static/icons/goods_spot.png
vendored
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
unpackage/dist/build/h5/static/icons/login-icon.png
vendored
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
unpackage/dist/build/h5/static/icons/logs-null.png
vendored
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
unpackage/dist/build/h5/static/icons/order-null.png
vendored
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 937 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 1015 B |
|
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 303 B |
BIN
unpackage/dist/build/h5/static/icons/search-icon.png
vendored
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 13 KiB |
BIN
unpackage/dist/build/h5/static/icons/store_down.png
vendored
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 491 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 4.9 KiB |
BIN
unpackage/dist/build/h5/static/icons/ticket-icon.png
vendored
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 401 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.0 KiB |
BIN
unpackage/dist/build/h5/static/icons/wechat.png
vendored
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
unpackage/dist/build/h5/static/img/404.74da6030.png
vendored
|
Before Width: | Height: | Size: 10 KiB |
BIN
unpackage/dist/build/h5/static/img/404.da3c9a6e.png
vendored
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
unpackage/dist/build/h5/static/img/WechatIMG9663.aa27fd0a.png
vendored
Normal file
|
After Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 14 KiB |
BIN
unpackage/dist/build/h5/static/img/chain-back-00.599e7c68.png
vendored
Normal file
|
After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
BIN
unpackage/dist/build/h5/static/img/idcard-positive.36388518.png
vendored
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 25 KiB |
BIN
unpackage/dist/build/h5/static/img/idcard-reverse.86d808e7.png
vendored
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 13 KiB |
BIN
unpackage/dist/build/h5/static/img/sign_tips.36ee104f.png
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 32 KiB |
BIN
unpackage/dist/build/h5/static/img/vipExamine.534ee9d4.png
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 38 KiB |
BIN
unpackage/dist/build/h5/static/imgs/bankLogo.png
vendored
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
unpackage/dist/build/h5/static/imgs/cart_empty.png
vendored
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
unpackage/dist/build/h5/static/imgs/company-icon.png
vendored
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 880 B |
BIN
unpackage/dist/build/h5/static/imgs/crystal-sign.png
vendored
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 306 B |
BIN
unpackage/dist/build/h5/static/imgs/link-wechat.png
vendored
|
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 682 B |
BIN
unpackage/dist/build/h5/static/imgs/mine-about.png
vendored
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 730 B |
BIN
unpackage/dist/build/h5/static/imgs/news_1.png
vendored
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
unpackage/dist/build/h5/static/imgs/news_2.png
vendored
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
unpackage/dist/build/h5/static/imgs/news_2_1.png
vendored
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 590 B |
BIN
unpackage/dist/build/h5/static/imgs/news_3.png
vendored
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
unpackage/dist/build/h5/static/imgs/no-avatar.png
vendored
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
unpackage/dist/build/h5/static/imgs/record-icon.png
vendored
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 904 B |
BIN
unpackage/dist/build/h5/static/imgs/reset-info.png
vendored
|
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 614 B |
BIN
unpackage/dist/build/h5/static/imgs/self-icon.png
vendored
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 619 B |
BIN
unpackage/dist/build/h5/static/imgs/top_bg.png
vendored
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 8.3 KiB |
BIN
unpackage/dist/build/h5/static/imgs/user-avatar.png
vendored
|
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 643 B |