Commit f22d8017 by wenyang

支持IOS与安卓配置

parent 8e58faec
......@@ -388,5 +388,8 @@ export default {
//轮播图
getBanner(params) {
return request(`${apiURL}/metadata/getBanner`, 'POST', params)
},
appointment(params) {
return request(`${cffpURL}/course/appointment`, 'POST', params)
}
}
<template>
<!-- 登录弹窗 -->
<view>
<uni-popup ref="loginPopup" :mask-click="false">
<view class="loginPopupBox">
<view class="loginPopupTitle">
<view>
<text>预约课程</text>
</view>
<view class="iconGuanbi">
<text @click="canle" class="iconfont icon-guanbi"></text>
</view>
</view>
<view class="loginPopupInput">
<view class="loginPopupInputLine" style="margin-bottom: 30rpx;">
<input style="font-size: 28rpx;" v-model="mobile" maxlength="11" type="number"
placeholder="请输入手机号">
</view>
<view class="loginPopupInputLine"
style="display: flex;justify-content: space-between;align-items: center;">
<input style="font-size: 28rpx;" v-model="code" maxlength="6" type="number"
placeholder="请输入验证码">
<view @click="c_sendCode"
style="color: #20269B;width: 200rpx;font-size: 30rpx;text-align: right;">
{{sendCodeHtml}}
</view>
</view>
</view>
<!-- <view class="agree">
<label class="radio" style="padding-right: 5rpx;">
<radio style="transform:scale(0.8);" :checked="agreeFlag" @click="agreeFlag=!agreeFlag" />
</label>
<text>已阅读并同意</text>
<text class="file" @click="getFile(1)">服务协议</text>
<text></text>
<text class="file" @click="getFile(2)">隐私政策</text>
</view> -->
<view class="loginPopupButtonBox">
<!-- <view @click="canle"><button class="popup_replenish_button2" size="mini">取消</button></view> -->
<view @click="confirm"><button class="popup_replenish_button" >确认</button></view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import api from "@/api/api";
import common from '../../common/common';
export default{
data(){
return{
//验证码倒计时
remainTimes: 60,
//验证码文字
sendCodeHtml: '获取验证码',
//计时器
timer: null,
//手机号
mobile: null,
//验证码
code: null,
//是否同意协议
agreeFlag:false,
}
},
methods:{
getFile(type){
uni.navigateTo({
url:`/components/clause/clause?type=${type}`
})
},
confirm() {
if (!common.mobileNoValid(this.mobile)) {
uni.showToast({
icon: 'none',
title: '手机号格式错误',
duration: 2000
})
return;
}
if (!this.code) {
uni.showToast({
icon: 'none',
title: '请输入验证码',
duration: 2000
})
return;
}
// if(this.agreeFlag == false) {
// uni.showToast({
// title: '请阅读并勾选江苏赢盾财务顾问有限公司服务协议和隐私条款',
// duration: 2000,
// icon: 'none'
// });
// return;
// }
//登录
const params = {
loginType: '3',
mobile: this.mobile,
code: this.code
}
api.loginVerification(params).then((res) => {
if (res['success']) {
uni.setStorageSync('isLogin', '1');
uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', res.data['userId']);
uni.setStorageSync('uni-token', res.data['token']);
//关闭弹窗
this.$refs.loginPopup.close();
uni.$emit('loginUpdate');
//调用父组件函数处理剩余逻辑
this.$emit('confirm');
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
},
canle(){
this.$refs.loginPopup.close();
this.$emit('canle');
},
open(){
this.$refs.loginPopup.open('bottom');
},
//点击发送验证码
c_sendCode() {
let phoneRs = common.mobileNoValid(this.mobile);
if (this.remainTimes != 60) {
return;
}
if (phoneRs) {
uni.showLoading({
mask: true
});
api.verificationCode({
"mobileNo": this.mobile,
"type": "1",
"source": "cffp"
}).then(res => {
uni.hideLoading();
if (res['success']) {
uni.showToast({
icon: 'none',
title: '发送成功',
duration: 2000
})
this.delayTime();
} else {
uni.showToast({
icon: 'none',
title: res['message'],
duration: 2000
})
}
})
} else {
uni.showToast({
icon: 'none',
title: '手机号格式错误',
duration: 2000
})
}
},
//开启计时器
delayTime() {
this.timer = setInterval(() => {
this.remainTimes--;
this.sendCodeHtml = `${this.remainTimes}(S)`;
if (this.remainTimes <= 0) {
this.sendCodeHtml = '获取验证码';
this.remainTimes = 60;
clearInterval(this.timer);
}
}, 1000);
}
}
}
</script>
<style lang="scss" scoped>
:deep .uni-popup__wrapper{
margin: 0rpx !important;
}
.loginPopupBox {
background-color:#fff;
border-radius: 30rpx 30rpx 0 0;
font-size: 30rpx;
.loginPopupTitle {
padding: 30rpx;
font-weight: bold;
border-bottom: #dfdfdf 1rpx solid;
display: flex;
justify-content: space-between;
align-items: center;
.iconGuanbi{
font-size: 20rpx;
}
}
.loginPopupInput {
padding: 30rpx;
.loginPopupInputLine {
background-color: #eee;
padding: 25rpx;
border-radius: 5px;
}
}
.loginPopupButtonBox {
// display: flex;
// justify-content: space-around;
padding:20rpx 30rpx 30rpx 30rpx;
.popup_replenish_button {
color: #fff;
background-color: rgba(9, 44, 171, 1);
border-radius: 200rpx;
padding:3rpx 0rpx;
font-size: 32rpx;
}
.popup_replenish_button2 {
color: rgba(9, 44, 171, 1);
background-color: #fff;
border: 1rpx solid rgba(9, 44, 171, 1);
border-radius: 200rpx;
padding: 0rpx 50rpx;
font-size: 30rpx;
}
}
.agree {
font-size: 28rpx;
color: #666;
text-align: center;
margin-top: 40rpx;
.file {
color: #20279B;
text-decoration: none;
}
}
}
</style>
\ No newline at end of file
<template>
<!-- 登录弹窗 -->
<view>
<uni-popup ref="verifyPopup" :mask-click="false">
<view class="loginPopupBox" style="text-align: center;width: 570rpx;padding-top: 50rpx;">
<view class="loginPopupTitle">
{{title}}
</view>
<view class="loginPopupContent">
{{content}}
</view>
<view class="loginPopupButtonBox">
<view @click="canle"><button class="popup_replenish_button2" size="mini">取消</button>
</view>
<view @click="confirm"><button class="popup_replenish_button" size="mini">确认</button>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import api from "@/api/api";
import common from '../../common/common';
export default{
props:{
title: {
type: String
},
content: {
type: String
},
},
data(){
return{
}
},
methods:{
confirm() {
this.$emit('confirm');
},
canle(){
this.$refs.verifyPopup.close();
this.$emit('canle');
},
open(){
this.$refs.verifyPopup.open();
},
}
}
</script>
<style lang="scss">
.loginPopupBox {
margin-top: 5vh;
padding: 25rpx 30rpx;
border-radius: 20rpx;
font-size: 30rpx;
background: #fff;
.loginPopupTitle {
font-weight: bold;
}
.loginPopupContent{
color: #20269B;
margin-top: 40rpx;
font-size: 28rpx;
}
.loginPopupButtonBox {
display: flex;
justify-content: space-around;
margin: 60rpx 0 10rpx 0;
.popup_replenish_button {
color: #fff;
background-color: rgba(9, 44, 171, 1);
border-radius: 200rpx;
padding: 0rpx 50rpx;
font-size: 30rpx;
}
.popup_replenish_button2 {
color: rgba(9, 44, 171, 1);
background-color: #fff;
border: 1rpx solid rgba(9, 44, 171, 1);
border-radius: 200rpx;
padding: 0rpx 50rpx;
font-size: 30rpx;
}
}
}
</style>
\ No newline at end of file
......@@ -18,19 +18,20 @@ let companyInfo = {
// appName: 'CFFP财富中心',
// companyName: '赢盾财务顾问',
// companyFullName: '江苏赢盾财务顾问有限公司',
// companyLogo:'../../static/cffp_logo.png',
// companyLogo:'../../static/cffp_logo.png',
companyType: '2',
appName: '银盾家办',
companyName: '银盾家办',
companyFullName: '银盾家办(广州)企业管理咨询有限公司',
companyLogo:'../../static/yd_Logo.png'
companyLogo:'../../static/yd_Logo.png',
systemType: 'NoIOS'
}
const config = {
dev,
stage,
prod
}
let env = 'dev';
let env = 'prod';
let baseURL = config[env].base_url;
let apiURL = config[env].api_url;
......
......@@ -67,7 +67,7 @@
<strong v-if="(courseInfo.status==1 || courseInfo.status==2 )&& courseInfo.coursePrice == 0">免费</strong>
<!-- <text v-if="courseInfo.status==2" style="color: #F15A1F;margin-right: 20rpx;"><i
class="iconfont icon-yifukuan"></i>已购</text> -->
<text v-if="courseInfo.coursePrice != 0">{{courseInfo.salesNumber}}购买</text>
<text v-if="courseInfo.coursePrice != 0">{{courseInfo.salesNumber}}{{showName}}</text>
</view>
......@@ -134,9 +134,8 @@
</h4>
<view v-html="lecturerInfo?.lecturerIntroduce" class="lecturerText richTextContent"></view>
</view>
<!-- 购买按钮 -->
<view class="buyBox" @click="saveOrder()" v-if="(courseInfo.status == 1 || courseInfo.status == 2) && courseInfo.coursePrice != 0">
<text>购买</text>
<text>{{showName}}</text>
</view>
</view>
......@@ -152,26 +151,58 @@
</view>
</view>
</view>
<login-popup ref="loginPopupCom" @confirm="c_confirmLoginPopup" @canle="canleLogin" ></login-popup>
<verify-popup ref="verifyPopupCom" title="温馨提示" content="请问您确认预约本课程吗?" @confirm="c_confirmVerifyPopup" @canle="canleVerify" >
</verify-popup>
<uni-popup ref="subscribeSuccessPopup" :mask-click="false">
<view class="loginPopupBox" style="text-align: center;width: 630rpx;padding-top: 35rpx;letter-spacing: 1rpx;">
<view style="display: flex;align-items: center;;justify-content: center;font-size: 32rpx;font-weight: bold;color: #20269B;margin:40rpx 0 60rpx 0;">
<view style="width: 6%;margin-right: 10rpx;margin-bottom: -10rpx;">
<image src="../../static/images/correct.png" mode="widthFix"></image>
</view>
<view>
恭喜您预约成功!
</view>
</view>
<view style="text-align: left;padding:0 10rpx 10rpx 10rpx;font-size: 24rpx;color: #7a7a7a;">
{{successMessage}}
</view>
<view style="margin-top: 10rpx;">
<view @click="c_closeSubscribeSuccessPopup"><button class="popup_replenish_button2" size="mini">关闭</button>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import api from "../../api/api";
import BootPage from "@/components/bootpage/bootpage.vue";
import LoginPopup from "@/components/unipopup/loginPopup.vue";
import VerifyPopup from "@/components/unipopup/verifyPopup.vue";
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling";
import {hshare} from '@/util/fiveshare';
import {nanoid} from 'nanoid';
import common from '../../common/common';
import {baseURL,apiURL,cffpURL} from "@/environments/environment";
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
export default {
components: {
UniShareWx,
BootPage
BootPage,
LoginPopup,
VerifyPopup
},
data() {
return {
systemType:companyInfo.systemType,
showName:'购买',
successMessage:'',
show:false,
isWxH5:false,
bannerViewType: '1',
swiperList: [],
......@@ -233,6 +264,43 @@
};
},
methods: {
canleLogin(){
this.show=false;
},
canleVerify(){
this.show=false;
},
//关闭预约成功弹窗
c_closeSubscribeSuccessPopup() {
this.show=false;
this.$refs.subscribeSuccessPopup.close();
},
//预约成功组件点击确认后的回调函数
c_confirmVerifyPopup() {
api.appointment({
userId: uni.getStorageSync('cffp_userId'),
courseId: this.fileId
}).then((res) => {
if (res['success']) {
this.$refs.verifyPopupCom.canle();
this.show=true;
this.successMessage=res['message'];
this.$refs.subscribeSuccessPopup.open();
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
},
// 登录组件成功后回调函数
c_confirmLoginPopup() {
//登录完成之后 弹出预约弹窗
this.$refs.verifyPopupCom.open();
},
close(val,loginTypeSync) {
if (val) {
this.sharelogin = false
......@@ -393,29 +461,46 @@
url: val.item.link
})
}
},
// 订单保存
saveOrder() {
this.loginType = uni.getStorageSync('loginType');
if (this.loginType === 'visitor') {
this.sharelogin = true
/* uni.navigateTo({
url: '/components/login/login'
}) */
if(this.systemType == 'IOS'){
this.$refs.loginPopupCom.open();
this.show=true;
}else{
this.sharelogin = true;
}
} else {
if (this.coursesharing == '1') {
this.h5jump()
} else {
this.jumppurchase()
if(this.systemType == 'IOS'){
this.$refs.verifyPopupCom.open();
this.show=true;
}else{
this.jumppurchase();
}
}
}
},
h5jump() {
let h5userId = uni.getStorageSync('cffp_userId');
if (h5userId) {
this.jumppurchase()
if(this.systemType == 'IOS'){
this.show=true;
this.$refs.verifyPopupCom.open();
}else{
this.jumppurchase();
}
} else {
this.sharelogin = true
if(this.systemType == 'IOS'){
this.show=true;
this.$refs.loginPopupCom.open();
}else{
this.sharelogin = true;
}
}
},
jumppurchase() {
......@@ -818,6 +903,10 @@
}
},
onLoad(option) {
if(this.systemType == 'IOS'){
this.showName = '预约';
this.show = false;
}
this.fileId = option.fileId;
this.courseInfo.packFileId = option.packFileId;
this.deviceType = common.checkDeviceType();
......@@ -849,21 +938,21 @@
},
onShow() {
//this.switchTab(1);
this.loginType = uni.getStorageSync('loginType')
this.init();
this.isWx_Miniprogram();
this.tabType = 1;
this.courseDetail();
this.loginType = uni.getStorageSync('loginType')
uni.setStorageSync('entryUrl',window.location.href.split('#')[0])
},
mounted() {
let _this = this;
if(this.isWeixin){
var btn = document.getElementById('launch-btn');
btn.addEventListener('launch', function(e) {
//var btn = document.getElementById('launch-btn');
//btn.addEventListener('launch', function(e) {
//console.log('success');
});
btn.addEventListener('error', function(e) {
//});
//btn.addEventListener('error', function(e) {
// uni.navigateTo({
// url:'/pages/downloadAppCommon/downloadAppCommon'
// })
......@@ -887,7 +976,7 @@
// }
// }
// });
});
//});
}
},
......@@ -910,6 +999,21 @@
page {
padding: 0;
}
.loginPopupBox {
margin-top: 8vh;
padding: 20rpx 30rpx;
border-radius: 20rpx;
font-size: 30rpx;
background: #fff;
.popup_replenish_button2 {
color: rgba(9, 44, 171, 1);
background-color: #fff;
border: 1rpx solid rgba(9, 44, 171, 1);
border-radius: 200rpx;
padding: 0rpx 50rpx;
font-size: 30rpx;
}
}
.swiperBox {
height: 930rpx;
image {
......
......@@ -29,11 +29,17 @@
levelaName:'',
mobileNumber:'',
name:'',
companyType:'',
}
},
onLoad(options) {
this.shareId = options.shareId
this.invitationCode = options.invitationCode
this.companyType = options.companyType;
if(this.companyType == '1'){
this.imgSrc = '../../static/cffp_logo.png';
this.areaName = '赢盾财务顾问';
}
this.getqueryById()
},
methods:{
......@@ -50,7 +56,7 @@
},
ckregister(){
uni.navigateTo({
url:`/pages/invitationRegister/invitationlogin?name=${this.name}&mobile=${this.mobileNumber}&shareId=${this.shareId}`
url:`/pages/invitationRegister/invitationlogin?companyType=${this.companyType}&name=${this.name}&mobile=${this.mobileNumber}&shareId=${this.shareId}`
})
}
}
......
......@@ -44,6 +44,7 @@
export default {
data() {
return {
companyType:'',
areaName: companyInfo.companyName,
imgSrc:'../../static/yd_Logo.png',
//imgSrc: '../../static/cffp_logo.png',
......@@ -68,6 +69,11 @@
this.form.areaId = options.areaId
this.form.invitationCode = options.invitationCode
this.form.partnerLevel = options.partnerLevel
this.companyType = options.companyType;
if(this.companyType == '1'){
this.imgSrc = '../../static/cffp_logo.png';
this.areaName = '赢盾财务顾问';
}
// this.form =JSON.parse( options.form)
},
methods:{
......
......@@ -144,10 +144,12 @@
import api from "@/api/api"
import common from '../../common/common';
import {hshare } from '@/util/fiveshare';
import {baseURL,apiURL,cffpURL} from "@/environments/environment";
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
export default {
data() {
return {
companyType:companyInfo.companyType,
ydLogoShare: `${baseURL}/appYdhomeoffice/static/yd_LogoShare.png`,
dataForm: {
applyType: '1', //申请类型邀请加盟传 1 申请加盟传 2
operatStep: '1', // 99:最后一步,1:第一步,2:为第二步该obj 为第一步
......@@ -181,6 +183,9 @@
//this.partnerLevel = option.levelCode
this.partnerLevel = 'P1'
//this.getqueryOrgList()
if(this.companyType == '1'){
this.ydLogoShare = `${baseURL}/appYdhomeoffice/static/cffp_logo.jpg`;
}
let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName;
this.invitationCode = dataForm.invitationCode
......@@ -294,9 +299,9 @@
//desc: `我是家庭财务策划师${this.realName}正在使用银盾家办,点击即刻加入!`,
desc: `${this.realName}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`,
link: "https://" + window.location.host +
"/appYdhomeoffice/pages/invitationRegister/invitationRegister?shareId=" +
"/appYdhomeoffice/pages/invitationRegister/invitationRegister?companyType="+this.companyType+"&shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode, //分享链接
imgUrl: `${baseURL}/appYdhomeoffice/static/yd_Logo.png`, //图片
imgUrl: this.ydLogoShare, //图片
//imgUrl: `${baseURL}/static/cffp_logo.jpg`, //图片
}
//安卓机型获取当前页面路径
......@@ -335,11 +340,11 @@
provider: "weixin",
scene: type === 1 ? "WXSceneSession" : "WXSceneTimeline",
type: 0,
href: `${baseURL}/appYdhomeoffice/pages/invitationRegister/invitationRegister?shareId=${this.shareId}&invitationCode=${this.invitationCode}`,
href: `${baseURL}/appYdhomeoffice/pages/invitationRegister/invitationRegister?companyType=${this.companyType}&shareId=${this.shareId}&invitationCode=${this.invitationCode}`,
title: "银盾家办家庭财务策划师联盟邀您加入",
//summary: `我是家庭财务策划师${this.realName}正在使用银盾家办,点击下载即刻加入!`,
summary: `${this.realName}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`,
imageUrl: `${baseURL}/appYdhomeoffice/static/yd_Logo.png`, //图片
imageUrl: this.ydLogoShare, //图片
//imageUrl: `${baseURL}/static/cffp_logo.jpg`,
success: function(res) {
console.log("success:" + JSON.stringify(res));
......
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