Commit c43fb4b1 by zhangzhen

细节优化

parent c8097a85
......@@ -80,11 +80,16 @@
uni.showLoading({
title: "授权中"
})
register({
let registData = {
loginCode:res.code,
phoneCode: this.phoneCode,
type: "routine",
}).then(res => {
type: "routine"
}
if(uni.getStorageSync("shareUserId")){
registData.uid = uni.getStorageSync("shareUserId");
registData.activityType = 0;
}
register(registData).then(res => {
uni.hideLoading();
if (res.data.code == 200) {
uni.setStorageSync('tokenHeaders', "Authori-zation")
......
......@@ -51,11 +51,16 @@
uni.showLoading({
title: "授权中"
})
register({
let registData = {
loginCode:res.code,
phoneCode: this.phoneCode,
type: "routine",
}).then(res => {
type: "routine"
}
if(uni.getStorageSync("shareUserId")){
registData.uid = uni.getStorageSync("shareUserId");
registData.activityType = 0;
}
register(registData).then(res => {
uni.hideLoading();
if (res.data.code == 200) {
uni.setStorageSync('tokenHeaders', "Authori-zation")
......
......@@ -150,6 +150,13 @@
"style": {
"navigationBarTitleText": "设备控制"
}
},
{
"path" : "pages/userShare/userShare",
"style" :
{
"navigationBarTitleText" : "分享"
}
}
],
"subPackages": [
......
......@@ -46,6 +46,10 @@
<image class="img" :src="assetsPath+'/setting.png'" mode="scaleToFill"></image>
<text class="text-gray">修改资料</text>
</view>
<view v-if="loginStatus" class="nav-right nav-right-2" @tap.stop="onNavToShare">
<text class="text-gray">邀请有礼</text>
</view>
</view>
<view class="remeber-info-box">
......@@ -279,6 +283,14 @@
<text class="text-gray">联系我们</text>
</view>
</view>
<view v-if="loginStatus" class="item-box" @tap="onShareByQrcode">
<view class="icon-img">
<image :src="assetsPath+'/user/tool_7.png'" mode="scaleToFill"></image>
</view>
<view class="text-box">
<text class="text-gray">二维码分享</text>
</view>
</view>
</view>
</view>
......@@ -396,11 +408,50 @@
</view>
</view>
</uni-popup>
<uni-popup ref="popupShare" type="center">
<view class="popup-box-content popup-box-share">
<view class="popup-box popup-box-2">
<view class="close-box" @tap="onClose">
<text class="cuIcon-close text-xl text-icon"></text>
</view>
<view class="title-header">
<text class="text-title text-black text-lg text-bold">分享邀请</text>
</view>
<view class="flex-col popup-content">
<view class="share-qrcode">
<view class="qrcode-box">
<tki-qrcode ref="qrcode" :cid="cid" :val="text" :size="size" unit="upx"
icon="../../static/logo_icon.png" :iconSize="iconSize" :onval="true" :loadMake="loadMake"
:showLoading="true" @result="qrR" />
</view>
<view class="part-bottom">
<button class="btn cu-btn bg-white" @tap="onSaveImg">
<image src="../../static/icon_album.png" mode="widthFix"></image>
<text>保存到相册</text>
</button>
<button open-type="share" class="btn cu-btn bg-blue">
<image src="../../static/share_icon_2.png" mode="widthFix"></image>
<text>分享邀请</text>
</button>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<LoginPop ref="loginPop" />
</view>
</template>
<script>
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
import LoginPop from "@/components/login/login"
import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import {
......@@ -424,10 +475,19 @@
export default {
components: {
LoginPop,
fTabbar
fTabbar,
tkiQrcode
},
data() {
return {
cid: "qrCode",
qrPath: '',
text: '生成中',
size: 520,
iconSize: 52,
colorDark: '#000000',
loadMake: false,
qrPath: '',
statusBarHeight: this.statusBarHeight,
assetsPath: config.assetsPath,
hostUrl: config.hostUrl,
......@@ -490,12 +550,36 @@
this.onGetSysConfig();
this.onGetUserInfo();
},
onLoad() {
onLoad(query) {
console.log(query,"页面传递过来的参数")
if (query.q) {
const q = decodeURIComponent(query.q)
let d = q.split('?')
let c = d[1].split('&')
let obj = {};
c.forEach(item => {
let l = item.split('=');
obj[l[0]] = l[1];
})
console.log(obj,"参数对象")
if (obj.uid) {
uni.setStorageSync("shareUserId", obj.uid)
}
}
if (query.uid) {
uni.setStorageSync("shareUserId", query.uid)
}
uni.hideTabBar();
if(!this.loginStatus){
this.$refs.loginPop.open();
}
},
onShareAppMessage() {
return {
title: "邀请扫码注册",
path: `/pages/my/myInfo?uid=${this.userInfo.id}`
}
},
methods: {
onNavToLogin(){
if(!this.loginStatus){
......@@ -743,6 +827,7 @@
onClose() {
this.$refs.popup.close()
this.$refs.popupPay.close()
this.$refs.popupShare.close()
},
onNavToRecords(t){
if(this.loginStatus){
......@@ -772,7 +857,35 @@
} else {
this.$refs.loginPop.open();
}
},
onNavToShare(){
uni.navigateTo({
url:"/pages/userShare/userShare"
})
},
qrR(r) {
console.log(r, "二维码路径")
this.qrPath = r;
},
onShareByQrcode(){
this.text = `https://www.coujio.com/myShare?uid=${this.userInfo.id}&act=0`;
this.loadMake = true;
this.$refs.popupShare.open()
},
onSaveImg() {
uni.saveImageToPhotosAlbum({
filePath: this.qrPath,
success: () => {
uni.showToast({
icon: 'none',
title: '保存成功'
})
},
fail: (err) => {
console.log(err, 999)
}
})
},
}
}
</script>
......@@ -846,6 +959,15 @@
font-size: 30upx;
}
}
.nav-right-2{
top: 82upx;
background-color: #E2177C;
padding: 10upx 12upx;
border-radius: 10upx;
text{
color: #ffffff;
}
}
}
......@@ -1395,7 +1517,6 @@
width: 72vw;
border-radius: 36upx;
overflow: hidden;
}
.popup-box-2{
position: relative;
width: 100%;
......@@ -1522,4 +1643,57 @@
}
}
}
}
.popup-box-share{
width: 90vw;
border-radius: 12upx;
overflow: hidden;
.popup-box-2{
background: #f1f1f1;
}
}
.share-qrcode {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
.qrcode-box {
background-color: #ffffff;
border-radius: 12upx;
box-shadow: 0 0 12upx #ff00ff;
padding: 20upx;
margin-top: 24upx;
}
.part-bottom {
display: flex;
flex-direction: row;
justify-content: center;
margin: 36upx 0;
width: 100%;
.btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex: 1;
height: 88upx;
border-radius: 20upx;
margin: 0 20upx;
image {
display: block;
width: 32upx;
height: auto;
margin-right: 6upx;
}
text {
font-size: 24upx;
}
}
}
}
</style>
\ No newline at end of file
......@@ -93,9 +93,9 @@
},
methods:{
onTypeChange(i){
if(this.index === i) return;
this.index = i;
this.onLoading();
// if(this.index === i) return;
// this.index = i;
// this.onLoading();
},
onLoading(){
memberConfigList({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment