Commit 972863a1 authored by Mac's avatar Mac

二维码的设置

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