Commit ce9f1689 authored by 罗超's avatar 罗超

1

parent 9b882ed3
<template> <template>
<div class="auth-page"> <div class="auth-page">
<u-popup v-model="showDialog" mode="center" :mask-close-able="false" custom-style="padding:0;background:none;"> <u-popup
v-model="showDialog"
mode="center"
:mask-close-able="false"
custom-style="padding:0;background:none;"
>
<img :src="pageinfo.pic_url" mode="widthFix" /> <img :src="pageinfo.pic_url" mode="widthFix" />
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" v-if="canIUseGetUserProfile == false" @getuserinfo="showLogin==true?getoldUser():''"></button> <button
<button :style="sureStyle" class="hotsopt" v-if="canIUseGetUserProfile == true" @tap="showLogin==true?getUserProfile():''"></button> :style="sureStyle"
class="hotsopt"
open-type="getUserInfo"
v-if="canIUseGetUserProfile == false"
@getuserinfo="showLogin == true ? getoldUser() : ''"
></button>
<button
:style="sureStyle"
class="hotsopt"
v-if="canIUseGetUserProfile == true"
@tap="showLogin == true ? getUserProfile() : ''"
></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button> <button :style="cancelStyle" class="hotsopt" @click="close"></button>
</u-popup> </u-popup>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon> <coupon
v-if="showCoupons"
:coupon-message="couponMessage"
:cform="ComeFrom"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</div> </div>
</template> </template>
<script> <script>
import coupon from "@/components/coupons/coupons"; import coupon from "@/components/coupons/coupons";
export default { export default {
components: { components: {
coupon coupon,
}, },
data() { data() {
return { return {
pageinfo: {}, pageinfo: {},
sureStyle: '', sureStyle: "",
cancelStyle: '', cancelStyle: "",
showDialog: true, showDialog: true,
showCoupons: false, showCoupons: false,
couponMessage: '', couponMessage: "",
ComeFrom:'', ComeFrom: "",
showLogin:true, showLogin: true,
canIUseGetUserProfile:false, canIUseGetUserProfile: false,
msg:{} msg: {},
}; };
}, },
created() { created() {
this.pageinfo = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').auth_page : {}; this.pageinfo = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").auth_page
: {};
if (wx.getUserProfile) { if (wx.getUserProfile) {
console.log('进入新的') console.log("进入新的");
this.canIUseGetUserProfile = true this.canIUseGetUserProfile = true;
} }
let x = this.pageinfo.hotspot; let x = this.pageinfo.hotspot;
let y = this.pageinfo.hotspot_cancel; let y = this.pageinfo.hotspot_cancel;
...@@ -42,7 +66,8 @@ ...@@ -42,7 +66,8 @@
this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`; this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
}, },
methods: { methods: {
getoldUser(){//旧的 兼容电脑端 getoldUser() {
//旧的 兼容电脑端
//4.27注释掉 给予新的提示不能在电脑端登录 //4.27注释掉 给予新的提示不能在电脑端登录
// var that = this; // var that = this;
// uni.login({ // uni.login({
...@@ -60,93 +85,93 @@ ...@@ -60,93 +85,93 @@
// } // }
// }); // });
uni.showToast({ uni.showToast({
title: '电脑端暂时不能获取用户信息,请转到手机端使用!', title: "电脑端暂时不能获取用户信息,请转到手机端使用!",
icon: 'none' icon: "none",
}); });
this.showDialog = false; this.showDialog = false;
this.$emit('gbAuth'); this.$emit("gbAuth");
}, },
getUserProfile(){//新的获取用户资料 getUserProfile() {
//新的获取用户资料
var that = this; var that = this;
wx.getUserProfile({ wx.getUserProfile({
desc: '用于完善资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: info => { success: (info) => {
console.log(info) console.log(info);
this.msg = { this.msg = {
Id: 0, Id: 0,
AliasName: info.userInfo.nickName, AliasName: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl, Photo: info.userInfo.avatarUrl,
}; };
that.getUserInfo(info) that.getUserInfo(info);
}, },
fail: () => { fail: () => {
uni.showToast({ uni.showToast({
title: '微信登录授权失败', title: "微信登录授权失败",
icon: 'none' icon: "none",
}); });
} },
}); });
}, },
getUserInfo(info) { getUserInfo(info) {
var that = this; var that = this;
that.showDialog = true; that.showDialog = true;
uni.getProvider({ uni.getProvider({
service: 'oauth', service: "oauth",
success: function(res) { success: function (res) {
if (~res.provider.indexOf('weixin')) { if (~res.provider.indexOf("weixin")) {
uni.login({ uni.login({
provider: 'weixin', provider: "weixin",
success: res => { success: (res) => {
//这里请求接口 //这里请求接口
let obj = { let obj = {
Source: 1, Source: 1,
OpenId: '', OpenId: "",
Name: info.userInfo.nickName, Name: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl, Photo: info.userInfo.avatarUrl,
Gender:info.userInfo.gender, Gender: info.userInfo.gender,
Moblie: '', Moblie: "",
SuperiorId: 0, SuperiorId: 0,
code: res.code code: res.code,
}; };
that.getCode(obj); that.getCode(obj);
}, },
fail: () => { fail: () => {
uni.showToast({ uni.showToast({
title: '微信登录授权失败', title: "微信登录授权失败",
icon: 'none' icon: "none",
}); });
} },
}); });
} else { } else {
uni.showToast({ uni.showToast({
title: '请先安装微信或升级版本', title: "请先安装微信或升级版本",
icon: 'none' icon: "none",
}); });
} }
} },
}); });
}, },
close() { close() {
this.showDialog = false; this.showDialog = false;
this.$emit('gbAuth'); this.$emit("gbAuth");
}, },
//调用获取code //调用获取code
getCode(obj) { getCode(obj) {
var that = this; var that = this;
uni.showLoading({ uni.showLoading({
title: '登录中' title: "登录中",
}); });
//这里请求接口 //这里请求接口
var OpenId = ''; var OpenId = "";
that.request2({ that.request2(
url: '/api/mall/GetWeChatOpenId', {
url: "/api/mall/GetWeChatOpenId",
data: { data: {
Code: obj.code Code: obj.code,
} },
}, },
res => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
obj.OpenId = res.data; obj.OpenId = res.data;
that.getLogin(obj); that.getLogin(obj);
...@@ -157,62 +182,77 @@ ...@@ -157,62 +182,77 @@
//登录 //登录
getLogin(obj) { getLogin(obj) {
var that = this; var that = this;
that.showLogin =false that.showLogin = false;
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0; let SmallShopId = uni.getStorageSync("SmallShopId")
let CounponPassword = uni.getStorageSync("CounponPassword") ? uni.getStorageSync("CounponPassword").CounponPassword : 0; ? uni.getStorageSync("SmallShopId").SmallShopId
let KeyWord = uni.getStorageSync("KeyWord") ? uni.getStorageSync("KeyWord").KeyWord : ''; : 0;
that.request2({ let CounponPassword = uni.getStorageSync("CounponPassword")
url: '/api/AppletLogin/Login', ? uni.getStorageSync("CounponPassword").CounponPassword
: 0;
let KeyWord = uni.getStorageSync("KeyWord")
? uni.getStorageSync("KeyWord").KeyWord
: "";
let EduSchoolId = uni.getStorageSync("EduSchoolId")
? uni.getStorageSync("EduSchoolId").EduSchoolId
: 0;
that.request2(
{
url: "/api/AppletLogin/Login",
data: { data: {
Source: 1, Source: 1,
OpenId: obj.OpenId, OpenId: obj.OpenId,
Name: obj.Name, Name: obj.Name,
Photo: obj.Photo, Photo: obj.Photo,
Gender:obj.Gender, Gender: obj.Gender,
Moblie: '', Moblie: "",
SuperiorId: pid, SuperiorId: pid,
SmallShopId: SmallShopId, SmallShopId: SmallShopId,
UserPageType: Up, UserPageType: Up,
CounponPassword:CounponPassword, CounponPassword: CounponPassword,
KeyWord:KeyWord, KeyWord: KeyWord,
} EduSchoolId: EduSchoolId,
},
}, },
res => { (res) => {
console.log(186, EduSchoolId);
uni.hideLoading(); uni.hideLoading();
that.showLogin=true;//防止多次点击登录 that.showLogin = true; //防止多次点击登录
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showDialog = false; this.showDialog = false;
uni.setStorageSync('mall_UserInfo', res.data); uni.setStorageSync("mall_UserInfo", res.data);
that.$emit('changeuserinfo'); that.$emit("changeuserinfo");
if (res.couponResultCode == 1) { if (res.couponResultCode == 1) {
if(uni.getStorageSync("ComeFrom")){ if (uni.getStorageSync("ComeFrom")) {
that.ComeFrom= uni.getStorageSync("ComeFrom").ComeFrom that.ComeFrom = uni.getStorageSync("ComeFrom").ComeFrom;
} }
that.showCoupons = true; that.showCoupons = true;
that.couponMessage = res.couponMessage; that.couponMessage = res.couponMessage;
} }
uni.removeStorageSync('pid'); uni.removeStorageSync("pid");
uni.removeStorageSync('SmallShopId'); uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("Up"); uni.removeStorageSync("Up");
uni.removeStorageSync("CounponPassword"); uni.removeStorageSync("CounponPassword");
uni.removeStorageSync("KeyWord"); uni.removeStorageSync("KeyWord");
let uid = uni.getStorageSync("mall_UserInfo").UserId; let uid = uni.getStorageSync("mall_UserInfo").UserId;
that.msg.Id = uid uni.removeStorageSync("EduSchoolId");
let IsOpenMiAi = uni.getStorageSync("basedata")?uni.getStorageSync("basedata").mall.setting.is_show_miai:0;//是否开启相亲模式 that.msg.Id = uid;
if(IsOpenMiAi==0){//不是相亲模式的时候去更新头像和昵称 let IsOpenMiAi = uni.getStorageSync("basedata")
that.updateuserinfo(that.msg);//更新用户头像 ? uni.getStorageSync("basedata").mall.setting.is_show_miai
: 0; //是否开启相亲模式
if (IsOpenMiAi == 0) {
//不是相亲模式的时候去更新头像和昵称
that.updateuserinfo(that.msg); //更新用户头像
} }
} }
} }
); );
}, },
updateuserinfo(msg) { updateuserinfo(msg) {
this.request2({ this.request2(
{
url: "/api/MemberUser/SetMemberPhoto", url: "/api/MemberUser/SetMemberPhoto",
data: msg, data: msg,
}, },
...@@ -226,26 +266,26 @@ ...@@ -226,26 +266,26 @@
this.showCoupons = false; this.showCoupons = false;
}, },
closeBtn() { closeBtn() {
this.showCoupons = false this.showCoupons = false;
} },
} },
}; };
</script> </script>
<style> <style>
.auth-page img { .auth-page img {
width: 650rpx; width: 650rpx;
height: 700rpx; height: 700rpx;
} }
.auth-page .hotsopt { .auth-page .hotsopt {
position: absolute; position: absolute;
background: transparent; background: transparent;
border: none; border: none;
outline: none; outline: none;
} }
.auth-page .hotsopt::after { .auth-page .hotsopt::after {
border: none; border: none;
} }
</style> </style>
\ No newline at end of file
...@@ -190,6 +190,8 @@ ...@@ -190,6 +190,8 @@
"root": "pages/share-qrcode", "root": "pages/share-qrcode",
"pages": [{ "pages": [{
"path": "share-qrcode" "path": "share-qrcode"
},{
"path": "share-select-school"
}] }]
}, },
{ {
...@@ -453,6 +455,8 @@ ...@@ -453,6 +455,8 @@
"path":"jieheactivityBM"//甲鹤活动报名 "path":"jieheactivityBM"//甲鹤活动报名
},{ },{
"path":"personal/JhphoneRz"//电话认证 "path":"personal/JhphoneRz"//电话认证
},{
"path":"picDetail"//相册详情
}] }]
}, },
//线下服务 //线下服务
......
...@@ -208,8 +208,9 @@ ...@@ -208,8 +208,9 @@
orderPopup orderPopup
}, },
onLoad(options) { onLoad(options) {
console.log(211,options)
let that = this; let that = this;
// options = {id:15,JumpType:16,type:'shopping mall'} // options = {user_id:125459,SmallShopId:0,EduSchoolId:79}
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
that.titleStyle = { that.titleStyle = {
...@@ -279,6 +280,11 @@ ...@@ -279,6 +280,11 @@
SmallShopId: options.SmallShopId SmallShopId: options.SmallShopId
}); });
} }
if (options && options.EduSchoolId) {
uni.setStorageSync("EduSchoolId", {
EduSchoolId: options.EduSchoolId
});
}
//从其他小程序跳转过来 //从其他小程序跳转过来
if (options && options.CounponPassword) {//小程序的来自 if (options && options.CounponPassword) {//小程序的来自
uni.setStorageSync("CounponPassword", { uni.setStorageSync("CounponPassword", {
...@@ -643,7 +649,7 @@ ...@@ -643,7 +649,7 @@
0; 0;
let CounponPassword = uni.getStorageSync("CounponPassword") ? uni.getStorageSync("CounponPassword").CounponPassword : 0; let CounponPassword = uni.getStorageSync("CounponPassword") ? uni.getStorageSync("CounponPassword").CounponPassword : 0;
let KeyWord = uni.getStorageSync("KeyWord") ? uni.getStorageSync("KeyWord").KeyWord : ''; let KeyWord = uni.getStorageSync("KeyWord") ? uni.getStorageSync("KeyWord").KeyWord : '';
let EduSchoolId = uni.getStorageSync("EduSchoolId") ? uni.getStorageSync("EduSchoolId").EduSchoolId : 0;
that.request2({ that.request2({
url: "/api/AppletLogin/Login", url: "/api/AppletLogin/Login",
data: { data: {
...@@ -657,6 +663,7 @@ ...@@ -657,6 +663,7 @@
UserPageType: Up, UserPageType: Up,
CounponPassword:CounponPassword, CounponPassword:CounponPassword,
KeyWord:KeyWord, KeyWord:KeyWord,
EduSchoolId:EduSchoolId,
}, },
}, },
(res) => { (res) => {
...@@ -672,6 +679,7 @@ ...@@ -672,6 +679,7 @@
uni.removeStorageSync("Up"); uni.removeStorageSync("Up");
uni.removeStorageSync("CounponPassword"); uni.removeStorageSync("CounponPassword");
uni.removeStorageSync("KeyWord"); uni.removeStorageSync("KeyWord");
uni.removeStorageSync("EduSchoolId");
that.getPageType() that.getPageType()
if (res.data.IsOpenSchool == 1) { //校园开启 if (res.data.IsOpenSchool == 1) { //校园开启
that.init() that.init()
......
...@@ -106,6 +106,73 @@ ...@@ -106,6 +106,73 @@
background: #CCCCCC; background: #CCCCCC;
} }
} }
.title-pic{
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
text-align: center;
margin-top: 30rpx;
}
.pic-name{
margin-bottom: 30rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.video-box{
display: flex;
flex-wrap: wrap;
& .pic-box:nth-child(3n){
margin-right: 0 !important;
}
.pic-box{
width: 222rpx;
height: 300rpx;
border-radius: 12rpx;
margin: 0 10rpx 30rpx 0;
.oneimg{
width: 222rpx;
height: 222rpx;
border-radius: 12rpx;
border: 1rpx solid #EEEEEE;
}
.fourimg-box{
width: 222rpx;
height: 222rpx;
border-radius: 12rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
border: 1rpx solid #EEEEEE;
.fourimg{
width: 105rpx;
height:105rpx;
border-radius: 11rpx;
// background-color: #000000;
}
}
.item-name{
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.item-num{
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
}
}
</style> </style>
<template> <template>
<view class="Jiaheactivitydetails"> <view class="Jiaheactivitydetails">
...@@ -175,6 +242,50 @@ ...@@ -175,6 +242,50 @@
</view> </view>
<view style="width: 100%;padding: 15px;margin-bottom: 150rpx;"> <view style="width: 100%;padding: 15px;margin-bottom: 150rpx;">
<view class="acdetail_Intro" v-html="richtext"></view> <view class="acdetail_Intro" v-html="richtext"></view>
<view class="title-pic" v-if="detial.FileGroup.length>0">
活动相册
</view>
<view class="pic-name" v-if="detial.FileGroup[0]">
视频
</view>
<view class="video-box">
<view v-for="(item,index) in detial.FileGroup[0].groupList" :key="index" class="pic-box" @click="goPicDetail(item.FileList)">
<image class="oneimg" :src="item.FileList[0].Path" mode="aspectFill" v-if="item.FileList.length<4" ></image>
<view class="fourimg-box" v-if="item.FileList.length>=4" >
<div v-for="(_item,_index) in item.FileList" :key="_item.id" class="subpic-box" v-if="_index<=3">
<!-- {{_item.Path}} -->
<image class="fourimg" :src="_item.Path" mode="aspectFill" ></image>
</div>
</view>
<view class="item-name">
{{item.Name}}
</view>
<view class="item-num">
{{item.FileList.length}}
</view>
</view>
</view>
<view class="pic-name" v-if="detial.FileGroup[1]">
图片
</view>
<view class="video-box">
<view v-for="(item,index) in detial.FileGroup[1].groupList" :key="index" class="pic-box" @click="goPicDetail(item.FileList)">
<image class="oneimg" :src="item.FileList[1].Path" mode="aspectFill" v-if="item.FileList.length<4" ></image>
<view class="fourimg-box" v-if="item.FileList.length>=4" >
<div v-for="(_item,_index) in item.FileList" :key="_item.id" class="subpic-box" v-if="_index<=3">
<image class="fourimg" :src="_item.Path" mode="aspectFill" ></image>
</div>
</view>
<view class="item-name">
{{item.Name}}
</view>
<view class="item-num">
{{item.FileList.length}}
</view>
</view>
</view>
</view> </view>
<view class="positionb"> <view class="positionb">
...@@ -206,10 +317,11 @@ ...@@ -206,10 +317,11 @@
</view> </view>
<view v-if="detial.IsJoinActivity==1"> <view v-if="detial.IsJoinActivity==1">
<view class="btnc" v-if="detial.IsSignUp==1">已报名</view> <view class="btnc" v-if="detial.IsSignUp==1">已报名</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
...@@ -239,6 +351,11 @@ ...@@ -239,6 +351,11 @@
}); });
}, },
methods:{ methods:{
goPicDetail(arr){
uni.navigateTo({
url:"/pages/school/picDetail?data=" + encodeURIComponent(JSON.stringify({data:arr}))
})
},
GetActivityDetial(){ GetActivityDetial(){
this.request2({ this.request2({
url: '/api/AppletEducation/GetActivityDetial', url: '/api/AppletEducation/GetActivityDetial',
......
...@@ -133,14 +133,15 @@ ...@@ -133,14 +133,15 @@
<view class="box-top"> <view class="box-top">
<view style="display: flex;"> <view style="display: flex;">
<view class="box-t-item" :class="{currentStyle:current == 1}" @click="listType(1)">即将开始</view> <view class="box-t-item" :class="{currentStyle:current == 1}" @click="listType(1)">即将开始</view>
<view class="box-t-item" :class="{currentStyle:current == 3}" @click="listType(3)">已结束</view>
<view class="box-t-item" :class="{currentStyle:current == 2}" @click="listType(2)">正在参加</view> <view class="box-t-item" :class="{currentStyle:current == 2}" @click="listType(2)">正在参加</view>
</view> </view>
<view class="box-top-r" @click="show=true" v-if="current == 1"> <view class="box-top-r" @click="show=true" >
<text class="box-top-r-text">{{ActivityName}}</text> <text class="box-top-r-text">{{ActivityName}}</text>
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/salesxiala.png" style="width: 17px;height: 17px;margin-left: 7px;"></image> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/salesxiala.png" style="width: 17px;height: 17px;margin-left: 7px;"></image>
</view> </view>
</view> </view>
<view v-show="current==1"> <view v-show="current==1||current==3">
<u-empty v-if="g.length == 0" text="暂无内容" mode="list"></u-empty> <u-empty v-if="g.length == 0" text="暂无内容" mode="list"></u-empty>
<view v-if=" g.length>0" <view v-if=" g.length>0"
class="scroll-box" class="scroll-box"
...@@ -273,6 +274,7 @@ ...@@ -273,6 +274,7 @@
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
ActivityType: 0, ActivityType: 0,
SelectIsEnd:0
}, },
ActivityName:'', ActivityName:'',
page_count: 1, page_count: 1,
...@@ -346,6 +348,9 @@ ...@@ -346,6 +348,9 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
let data = this.groupArr(res.data.pageData,'MonthStr'); let data = this.groupArr(res.data.pageData,'MonthStr');
let data2 = data let data2 = data
if( this.msg.pageIndex===1){
this.g=[]
}
if(this.g.length>0){ if(this.g.length>0){
data2.forEach(x=>{ data2.forEach(x=>{
if(x.Day == this.g[this.g.length-1].Day){//判断当前第一条数据和已有的是否同一天 放在一起 if(x.Day == this.g[this.g.length-1].Day){//判断当前第一条数据和已有的是否同一天 放在一起
...@@ -355,7 +360,10 @@ ...@@ -355,7 +360,10 @@
} }
}) })
} }
this.g = this.g.concat(data); this.g = this.g.concat(data);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if (this.page_count == 1) { if (this.page_count == 1) {
this.status = "nomore"; this.status = "nomore";
...@@ -413,8 +421,17 @@ ...@@ -413,8 +421,17 @@
}, },
listType(type){ listType(type){
this.current = type; this.current = type;
if(type==3){
this.msg.SelectIsEnd=1
this.msg.pageIndex=1;
this.init()
}else{
this.msg.SelectIsEnd=0
}
if(type==1){//TODO 暂时不知道接口 if(type==1){//TODO 暂时不知道接口
this.msg.pageIndex=1;
this.msg.SelectIsEnd=0
this.init()
}else{ }else{
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
......
<template> <template>
<view class="qrcodeStyle" :style="{'height':contentHeight}"> <view class="qrcodeStyle" :style="{'height':contentHeight}">
<u-top-tips ref="uTips"></u-top-tips> <u-top-tips ref="uTips"></u-top-tips>
<img :src="tempPic" mode="widthFix" style="width: 320px;margin-top: 20px;" /> <img :src="tempPic" mode="widthFix" style="width: 320px;margin-top: 20px;" />
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
<Text>保存图片分享赚钱</Text> <Text>保存图片分享赚钱</Text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
...@@ -21,6 +23,8 @@ ...@@ -21,6 +23,8 @@
UserInfo: '', UserInfo: '',
tempPic: '', tempPic: '',
type: 1, type: 1,
EduSchoolId: 0,
AppletID: 0, //判断是否是甲鹤小程序value:5
} }
}, },
created() { created() {
...@@ -31,6 +35,9 @@ ...@@ -31,6 +35,9 @@
}, },
onLoad(options) { onLoad(options) {
console.log(options, 'options') console.log(options, 'options')
if (options.schoolId) {
this.EduSchoolId = options.schoolId
}
if (options && options.type) { if (options && options.type) {
this.type = options.type this.type = options.type
if (this.type == 1) { if (this.type == 1) {
...@@ -44,12 +51,12 @@ ...@@ -44,12 +51,12 @@
} }
this.init() this.init()
} }
let basedata = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata") : '';
this.AppletID = basedata.home_pages.id ? basedata.home_pages.id : 0;
console.log(56, this.AppletID)
}, },
onReady() { onReady() {
},
mounted() {
}, },
methods: { methods: {
init() { init() {
...@@ -87,15 +94,39 @@ ...@@ -87,15 +94,39 @@
if (SmallShopId == 0) { if (SmallShopId == 0) {
SmallShopId = that.UserInfo.UserSmallShopId ? that.UserInfo.UserSmallShopId : 0; SmallShopId = that.UserInfo.UserSmallShopId ? that.UserInfo.UserSmallShopId : 0;
} }
if (that.AppletID == 5) {
that.request2({
url: '/api/AppletUser/GetWeiXinQRCodeForAppletSchool',
data: {
Path: '/pages/index/index?user_id=' + that.UserInfo.UserId + '&SmallShopId=' +
SmallShopId + '&EduSchoolId=' + this.EduSchoolId,
With: that.qrcode.QrCodeSize,
EduSchoolId: that.EduSchoolId,
}
},
(res) => {
console.log(103,this.EduSchoolId)
uni.hideNavigationBarLoading()
that.fenxqrcode = that.host2 + res.data;
console.log(that.fenxqrcode)
let tmpTimeout = setTimeout(() => {
that.drawCtx();
clearTimeout(tmpTimeout)
}, 100)
}
);
} else {
if (that.type == 1) { 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 + '&EduSchoolId=' + this.EduSchoolId,
With: that.qrcode.QrCodeSize, With: that.qrcode.QrCodeSize,
} }
}, },
(res) => { (res) => {
// console.log(103,this.EduSchoolId)
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'
...@@ -110,7 +141,8 @@ ...@@ -110,7 +141,8 @@
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 + '&Up=2', Path: '/pages/index/index?user_id=' + that.UserInfo.UserId + '&SmallShopId=' +
SmallShopId + '&Up=2' + '&EduSchoolId=' + this.EduSchoolId,
With: that.qrcode.QrCodeSize, With: that.qrcode.QrCodeSize,
} }
}, },
...@@ -125,6 +157,8 @@ ...@@ -125,6 +157,8 @@
} }
); );
} }
}
}, },
drawCtx() { drawCtx() {
uni.showLoading({ uni.showLoading({
...@@ -149,10 +183,13 @@ ...@@ -149,10 +183,13 @@
ctx.save(); // 先保存状态 已便于画完圆再用 ctx.save(); // 先保存状态 已便于画完圆再用
ctx.beginPath(); //开始绘制 ctx.beginPath(); //开始绘制
//先画个圆 //先画个圆
ctx.arc(that.qrcode.HeadSize / 2 + that.qrcode.HeadPaddingLeft, that.qrcode.HeadSize / 2 + that.qrcode.HeadPaddingTop, ctx.arc(that.qrcode.HeadSize / 2 + that.qrcode.HeadPaddingLeft,
that.qrcode.HeadSize / 2 + that.qrcode.HeadPaddingTop,
that.qrcode.HeadSize / 2, 0, Math.PI * 2, false); that.qrcode.HeadSize / 2, 0, Math.PI * 2, false);
ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 ctx
ctx.drawImage(image.path, that.qrcode.HeadPaddingLeft, that.qrcode.HeadPaddingTop, that.qrcode.HeadSize, .clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
ctx.drawImage(image.path, that.qrcode.HeadPaddingLeft, that
.qrcode.HeadPaddingTop, that.qrcode.HeadSize,
that.qrcode.HeadSize); //绘制头像 that.qrcode.HeadSize); //绘制头像
ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制 ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
if (that.qrcode.IsShowQrCode == 0) { //二维码 if (that.qrcode.IsShowQrCode == 0) { //二维码
...@@ -162,12 +199,22 @@ ...@@ -162,12 +199,22 @@
src: that.fenxqrcode, src: that.fenxqrcode,
success: function(image) { success: function(image) {
if (that.qrcode.QrCodeType == 0) { if (that.qrcode.QrCodeType == 0) {
ctx.arc(that.qrcode.QrCodeSize / 2 + that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodeSize / 2 + ctx.arc(that.qrcode.QrCodeSize /
that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize / 2, 0, Math.PI * 2, false); 2 + that.qrcode
ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 .QrCodePaddingLeft, that
} .qrcode.QrCodeSize / 2 +
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode that.qrcode
.QrCodeSize, that.qrcode.QrCodeSize); //绘制二维码 .QrCodePaddingTop, that
.qrcode.QrCodeSize / 2, 0,
Math.PI * 2, false);
ctx
.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
}
ctx.drawImage(image.path, that.qrcode
.QrCodePaddingLeft, that.qrcode
.QrCodePaddingTop, that.qrcode
.QrCodeSize, that.qrcode
.QrCodeSize); //绘制二维码
that.drawQrCode(ctx) that.drawQrCode(ctx)
}, },
}); });
...@@ -183,11 +230,17 @@ ...@@ -183,11 +230,17 @@
src: that.fenxqrcode, src: that.fenxqrcode,
success: function(image) { success: function(image) {
if (that.qrcode.QrCodeType == 0) { if (that.qrcode.QrCodeType == 0) {
ctx.arc(that.qrcode.QrCodeSize / 2 + that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodeSize / 2 + that.qrcode ctx.arc(that.qrcode.QrCodeSize / 2 + that.qrcode
.QrCodePaddingTop, that.qrcode.QrCodeSize / 2, 0, Math.PI * 2, false); .QrCodePaddingLeft, that.qrcode.QrCodeSize /
ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 2 + that.qrcode
} .QrCodePaddingTop, that.qrcode.QrCodeSize / 2,
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, 0, Math.PI * 2, false);
ctx
.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
}
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft,
that.qrcode.QrCodePaddingTop, that.qrcode
.QrCodeSize,
that.qrcode.QrCodeSize); //绘制二维码 that.qrcode.QrCodeSize); //绘制二维码
that.drawQrCode(ctx) that.drawQrCode(ctx)
}, },
...@@ -267,9 +320,18 @@ ...@@ -267,9 +320,18 @@
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.openSetting({ uni.openSetting({
success: (res) => { success: (
console.log(res); res
if (res.authSetting['scope.writePhotosAlbum']) { ) => {
console
.log(
res
);
if (res
.authSetting[
'scope.writePhotosAlbum'
]
) {
that.preservation() that.preservation()
} }
} }
......
...@@ -183,13 +183,13 @@ ...@@ -183,13 +183,13 @@
</view> </view>
</view> </view>
<view class="sharebox_menus" v-if="UserPageType.UserPageType!=2"> <view class="sharebox_menus" v-if="UserPageType.UserPageType!=2">
<view class="menus_item" @click="goUrl('/pages/share-qrcode/share-qrcode',1)"> <!-- <view class="menus_item" @click="goUrl('/pages/share-qrcode/share-qrcode',1)"> -->
<view class="menus_item" @click="goUrl('/pages/share-qrcode/share-select-school')">
<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><!--推广二维码-->
</view> </view>
<view style="display: flex;flex-direction: row;align-items: center;"> <view style="display: flex;flex-direction: row;align-items: center;">
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon> <u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view> </view>
</view> </view>
......
...@@ -417,6 +417,7 @@ ...@@ -417,6 +417,7 @@
let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0; let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0;
let CounponPassword = uni.getStorageSync("CounponPassword") ? uni.getStorageSync("CounponPassword").CounponPassword : 0; let CounponPassword = uni.getStorageSync("CounponPassword") ? uni.getStorageSync("CounponPassword").CounponPassword : 0;
let KeyWord = uni.getStorageSync("KeyWord") ? uni.getStorageSync("KeyWord").KeyWord : ''; let KeyWord = uni.getStorageSync("KeyWord") ? uni.getStorageSync("KeyWord").KeyWord : '';
let EduSchoolId = uni.getStorageSync("EduSchoolId") ? uni.getStorageSync("EduSchoolId").EduSchoolId : 0;
that.request2({ that.request2({
url: '/api/AppletLogin/Login', url: '/api/AppletLogin/Login',
data: { data: {
...@@ -430,6 +431,7 @@ ...@@ -430,6 +431,7 @@
UserPageType: Up, UserPageType: Up,
CounponPassword:CounponPassword, CounponPassword:CounponPassword,
KeyWord:KeyWord, KeyWord:KeyWord,
EduSchoolId:EduSchoolId,
} }
}, },
res => { res => {
...@@ -440,6 +442,7 @@ ...@@ -440,6 +442,7 @@
uni.removeStorageSync("Up"); uni.removeStorageSync("Up");
uni.removeStorageSync("CounponPassword"); uni.removeStorageSync("CounponPassword");
uni.removeStorageSync("KeyWord"); uni.removeStorageSync("KeyWord");
uni.removeStorageSync("EduSchoolId");
} }
} }
); );
......
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