Commit 972863a1 authored by Mac's avatar Mac

二维码的设置

parent a9aa36fb
......@@ -24,6 +24,7 @@
fenxqrcode:'',
UserInfo:'',
tempPic:'',
type:1,
}
},created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
......@@ -33,9 +34,16 @@
},
onLoad(options){
console.log(options,'options')
if(options && options.type){
this.type = options.type
this.init()
}
},
onReady(){
this.init()
},
mounted() {
......@@ -45,18 +53,35 @@
},
methods: {
init(){
uni.showNavigationBarLoading();
this.request2(
{
url: '/api/AppletUser/GetFenXiaoPoster',
data: {}
},
(res) => {
uni.hideNavigationBarLoading()
this.qrcode = res.data;
this.getWeiXinQRCode()
}
);
if(this.type==1){
this.request2(
{
url: '/api/AppletUser/GetFenXiaoPoster',
data: {}
},
(res) => {
uni.hideNavigationBarLoading()
this.qrcode = res.data;
this.getWeiXinQRCode()
}
);
}else if(this.type == 2){
this.request2(
{
url: '/api/AppletUser/GetFenXiaoPoster',
data: {IsOpenSchool:this.UserInfo.IsOpenSchool}
},
(res) => {
uni.hideNavigationBarLoading()
this.qrcode = res.data;
this.getWeiXinQRCode()
}
);
}
},
getWeiXinQRCode(){
let that = this
......@@ -65,27 +90,49 @@
if(SmallShopId==0){
SmallShopId = that.UserInfo.UserSmallShopId?that.UserInfo.UserSmallShopId:0;
}
console.log('pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId)
that.request2(
{
url: '/api/AppletUser/GetWeiXinQRCodeForApplet',
data: {
Path:'/pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
With:that.qrcode.QrCodeSize,
}
},
(res) => {
uni.hideNavigationBarLoading()
that.fenxqrcode = that.host2+res.data;
// that.fenxqrcode = 'https://mallapi.oytour.com/upfile/temporary/864369a3-8da8-4735-bcc8-a2dfe5c6f357.jpg'
console.log(that.fenxqrcode)
let tmpTimeout = setTimeout(()=>{
that.drawCtx();
clearTimeout(tmpTimeout)
},100)
}
);
if(that.type==1){
that.request2(
{
url: '/api/AppletUser/GetWeiXinQRCodeForApplet',
data: {
Path:'/pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
With:that.qrcode.QrCodeSize,
}
},
(res) => {
uni.hideNavigationBarLoading()
that.fenxqrcode = that.host2+res.data;
// that.fenxqrcode = 'https://mallapi.oytour.com/upfile/temporary/864369a3-8da8-4735-bcc8-a2dfe5c6f357.jpg'
console.log(that.fenxqrcode)
let tmpTimeout = setTimeout(()=>{
that.drawCtx();
clearTimeout(tmpTimeout)
},100)
}
);
}else if(that.type==2){
that.request2(
{
url: '/api/AppletUser/GetWeiXinQRCodeForApplet',
data: {
Path:'/pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId+'&Up='+ that.UserInfo.UserPageType,
With:that.qrcode.QrCodeSize,
}
},
(res) => {
uni.hideNavigationBarLoading()
that.fenxqrcode = that.host2+res.data;
console.log(that.fenxqrcode)
let tmpTimeout = setTimeout(()=>{
that.drawCtx();
clearTimeout(tmpTimeout)
},100)
}
);
}
},
drawCtx(){
uni.showLoading({
......@@ -302,7 +349,7 @@
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
margin: 20px;
}
.qrcodeStyle .imgbox{
width: 70%;
......
......@@ -4,7 +4,7 @@
@scroll="scrollHandler"
@scrolltoupper="scrollTopHandler"
style="height: 100vh;">
<view class="shareindexStyle" :style="{'height':contentHeight}">
<view class="shareindexStyle" >
<view
class="headStatus"
v-if="sharestatus.Status!=3"
......@@ -196,8 +196,8 @@
</view>
</view>
<view class="sharebox_menus">
<view class="menus_item" @click="goUrl('/pages/share-qrcode/share-qrcode')">
<view class="sharebox_menus" v-if="UserPageType.UserPageType!=2">
<view class="menus_item" @click="goUrl('/pages/share-qrcode/share-qrcode',1)">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="sharedata.CustomModel.PromoteQRCodeImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{sharedata.CustomModel.PromoteQRCodeName}}</text>
......@@ -208,6 +208,19 @@
</view>
</view>
</view>
<view class="sharebox_menus" v-if="UserPageType.IsOpenSchool==1">
<view class="menus_item" @click="goUrl('/pages/share-qrcode/share-qrcode',2)">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="sharedata.CustomModel.PromoteQRCodeImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">校园二维码</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
</view>
<view style="width: 100%;height: 30px;background: #f3f4f6;"></view>
</view>
......@@ -239,6 +252,7 @@
headStyle:{},
scrollTop:0,
words:{},
UserPageType:{},//校园的数据
}
},
created(){
......@@ -247,6 +261,7 @@
this.secondary = this.$uiConfig.secondary;
this.nav = uni.getMenuButtonBoundingClientRect().top;
this.headStyle.paddingTop = this.nav +'px';
this.UserPageType = uni.getStorageSync("UserPageType")?uni.getStorageSync("UserPageType"):{};
},
mounted() {
let currentPages = getCurrentPages();
......@@ -357,13 +372,17 @@
});
}
},
goUrl(url){
goUrl(url,type=1){
console.log(url)
if(url=='/pages/share-team/share-team' && this.sharedata.UserInfo.IsEnableFXGrade ==1){//判断我的团队是否粉象模式
uni.navigateTo({
url: url+'?IsEnableFXGrade='+ this.sharedata.UserInfo.IsEnableFXGrade
});
}else{
}else if(url=='/pages/share-qrcode/share-qrcode'){
uni.navigateTo({
url: url+'?type='+ type
});
} else{
uni.navigateTo({
url: url
});
......
......@@ -285,17 +285,18 @@ export default {
if(IsOpen==2)
{
if(SmallShopId==0 && UserSmallShopId!=0)
{
flag=false;
}
else{
flag=true;
}
// if(SmallShopId==0 && UserSmallShopId!=0)
// {
// flag=false;
// }
// else{
// flag=true;
// }
flag=true;
}
//关闭
else{
if(SmallShopId!=0)
if(SmallShopId!=0 || UserSmallShopId!=0 )
{
flag=true;
}
......
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