| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675 |
- <template>
- <view class="youyue">
- <view class="">
- <u-parse :content="memberInfo"></u-parse>
- </view>
- <!-- <view class="nav">
- <image src="http://t9.9026.com/imgs/logo@2x.png"></image>
- </view>
- <view class="title">
- IHG优悦会忠诚计划优悦随行悦享世界
- </view>
- <view class="detail">
- <view><text>IHG优悦会是洲际酒店集团的会员忠诚计划。在全球拥有超过1亿会员。</text></view>
- <view><text> 即刻加入HG优悦会,一键开启会员专享价及会员专属礼遇。轻松赚取积分,使用灵活的积分兑换及竞拍,畅享独特且多元的犒赏体验。</text></view>
- </view>
- <view class="boxitem">
- <text class="boxitemtitle">优悦会会员权益</text>
- </view>
- <view class="boxitem" style="border-top: none;">
- <text class="boxitemtitle">入会第一天起即可臻享礼遇</text>
- </view>
- <view class="boxitem" style="border-top: none;">
- <text class="boxitemtitle">赚取酒店积分兑换奖励住宿以及更多</text>
- <text class="boxitemcontent">积分不仅可以兑换体验,目录商品等,还可以兑换全球6000等多个目的地奖励住宿</text>
- <image src="/static/icon/loginicon1.png"></image>
- </view>
- <view class="boxitem" style="border-top: none;">
- <text class="boxitemtitle">会员专享价</text>
- <text class="boxitemcontent" style="margin-bottom: 30rpx;">直接预订可享受我们会员专属的优惠房价</text>
- <image src="/static/icon/loginicon2.png"></image>
- </view>
- <view class="boxitem" style="border-top: none;">
- <text class="boxitemtitle">会员促销</text>
- <text class="boxitemcontent" style="margin-bottom: 30rpx;">尽情享受会员促销,赚取更多奖励积分</text>
- <image src="/static/icon/loginicon3.png"></image>
- </view>
- <view class="item"><text class="itemtitle">畅享网络</text></view>
- <view class="itemLast">我们所有酒店均提供免费WIFI,让您始终顺畅连通</view> -->
-
- <view class="btn" @click="goOther">
- <text>立即加入会员</text>
- </view>
- <view class="logintitle">
- <view class="line"></view>
- <view class="logintype"><text>其他登录</text></view>
- <view class="line"></view>
- </view>
- <view class="typebtn" @click="getmsg">
- <view class="item">
- <image src="/static/icon/wechart.png" mode="scaleToFill"></image>
- <text>微信登录</text>
- </view>
- </view>
- <!-- <u-modal @close="closeMask" closeOnClickOverlay="true" :show="modal.show" :title="modal.title"
- :show-confirm-button="false">
- <view>
- <button class="avatar" open-type="chooseAvatar" @chooseavatar="handleChooseAvatar">
- <image class="user-avatar" style="height: 176rpx;width: 176rpx;border-radius: 50%;"
- :src="modal.avatar?modal.avatar:'/static/icon/avatar.png'" />
- </button>
- <input class="avatar" type="nickname" :value="modal.nickname" placeholder="填写昵称"
- @change="handleChangeNickname">
- <button class="confirm" @click="handleConfirmWechatUserInfo">提交</button>
- </view>
- </u-modal> -->
- <u-popup :show="modal.show" :round="10" mode="bottom" @close="close">
- <view class="popup-login">
- <view class="popup-login-top">
- <image style="width: 56rpx; height: 56rpx; margin-right: 20rpx; "
- src="https://t9.9026.com/imgs/loginLogo1.png" mode=""></image>
- <text>登录后体验更多功能</text>
- </view>
- <view class="popup-login-main">
- <button class="avatar" open-type="chooseAvatar" @chooseavatar="handleChooseAvatar">
- <image class="user-avatar" style="height: 176rpx;width: 176rpx;border-radius: 50%;"
- :src="modal.avatar?modal.avatar:'https://t9.9026.com/imgs/loginAvatar.png'" />
- </button>
- </view>
-
- <view class="popup-login-ipt">
- <input class="avatar" type="nickname" :value="modal.nickname" placeholder="输入昵称"
- @change="handleChangeNickname">
- </view>
-
- <view class="popup-login-btn" @click="handleConfirmWechatUserInfo">
- <button class="confirm">完成</button>
- </view>
-
- <view class="popup-login-text">
- <view style="display: flex;align-items: center;justify-content: center;">
- <text>登录即代表已阅读并同意</text>
- <view style="color: #FF6200;display: flex;align-items: center;justify-content: center;">
- <view @click="goAgreement">服务协议</view>
- <view @click="goPrivacy">、隐私协议</view>
- </view>
- </view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- //页面信息
- memberInfo:'',
- //跳转h5,小程序,其他页面
- jump_type: '',
- jump_config: {},
- //加入会员广告配置
- advise: '',
- imgBase64: '',
- isLoginOff: false,
- modal: {
- show: false,
- title: '用户信息获取',
- nickname: '',
- avatar: ''
- },
- code: '',
- encryptedData: '',
- iv: '',
- data: {}
- }
- },
- onLoad() {
- this.isLoginOff = this.$store.getters.userInfo
- this.advise = this.$store.getters.allset.add_member
- this.memberInfo = this.advise.value.member_info
- if(this.advise){
- this.jump_type = this.advise.value.member_info_jump_type
- if( this.jump_type == 1){
- this.jump_config = this.advise.value.member_info_h5_url
- }else if(this.jump_type == 2){
- this.jump_config.appid = this.advise.value.member_info_appid
- this.jump_config.path = this.advise.value.member_info_path
- }else if(this.jump_type == 3){
- this.jump_config =this.advise.value.member_info_other_path
- }
- }
-
-
- },
- methods: {
- //服务协议
- goAgreement() {
- console.log(111);
- uni.navigateTo({
- url: '/pages/my/protocol/UserAgreement'
- })
- },
-
- //隐私协议
- goPrivacy() {
- console.log(222);
- uni.navigateTo({
- url: '/pages/my/protocol/PrivacyPolicy'
- })
- },
-
- // 跳转其他小程序
- goOther() {
- this.jumpHAppID(this.jump_type, this.jump_config)
- },
- jumpHAppID(id, urls) {
- if (id == 1) {
- const url = urls; // 跳转的外链
- const navtitle = 'H5'; // 这个标题是你自己可以设置的
- uni.navigateTo({
- // 跳转到webview页面
- url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
- success: () => {
- console.log('成功')
- },
- fail: (e) => {
- console.log(e, "失败")
- }
- });
- } else if (id == 2) {
- let _this = this
- let obj = urls;
- console.log(obj, '----->obj');
- wx.navigateToMiniProgram({
- appId: `${obj.appid}`, //appid
- path: `${obj.path}`, //path
- extraData: { //参数
- foo: 'bar'
- },
- // envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
- success(res) {
- let page = _this.getPageUrl()
- console.log('成功', page)
- _this.$api.my.userMemberAdd({
- user_id: 0,
- page,
- }).then(res => {
- console.log(res.data);
- })
- // 打开成功
- },
- fail(e) {
- console.log(e, '失败')
- }
- })
- } else if (id == 3) {
- uni.redirectTo({
- url: urls,
- fail: (err) => {
- uni.reLaunch({
- url: urls
- })
- }
- })
- }
- },
- //关闭遮罩层
- closeMask() {
- this.modal.show = false
- },
- close() {
- this.modal.show = false
- },
- //提交微信名称和头像
- handleConfirmWechatUserInfo() {
- if (!this.modal.avatar) {
- this.$u.toast('请上传头像')
- return
- }
- if (!this.modal.nickname) {
- this.$u.toast('请填写昵称')
- return
- }
- this.$loading('数据提交中...')
- this.$api.my.update({
- avatar: this.modal.avatar,
- nickname: this.modal.nickname
- }).then(res => {
- this.$hideLoading()
- this.$store.dispatch('user/info', res.data)
- this.modal.show = false
- uni.switchTab({
- url: '/pages/my/my'
- })
- })
- },
- handleGetWechatUserInfo() {
- this.modal.show = true
- },
- // 微信获取头像
- handleChooseAvatar({
- detail
- }) {
- let _this = this
- uni.getFileSystemManager().readFile({
- filePath: detail.avatarUrl, // 选择图片返回的相对路径
- encoding: 'base64', // 编码格式
- success: res => { // 成功的回调
- uni.uploadFile({
- url: _this.$setting.BASE_URL + '/v1/user/uploadFile',
- // filePath: 'data:image/png;base64,' + res.data,
- filePath: detail.avatarUrl,
- name: 'file',
- success({
- data
- }) {
- const res = JSON.parse(data)
- const {
- url
- } = res.data
- _this.modal.avatar = url
- console.log('-->data', _this.modal.avatar)
- }
- })
- // this.modal.avatar = detail.avatarUrl
- // console.log('data:image/png;base64,' + res.data)
- }
- })
- },
- handleChangeNickname(res) {
- this.modal.nickname = res.detail.value
- },
- //获取当前页面路径
- getPageUrl() {
- const pages = getCurrentPages();
- console.log(pages, '--------->pages')
- if (pages.length == 1) {
- const currentPage = pages[0];
- let pageUrl = `/${currentPage.route}`;
- return pageUrl
- console.log('当前页面url:', pageUrl);
- } else {
- const currentPage = pages[pages.length - 1];
- let pageUrl = `/${currentPage.route}`;
- return pageUrl
- console.log('当前页面url:', pageUrl);
- }
- // pageUrl = this.pageUrl + '?id=' + this.detailID;
- },
- //登录
- getCode() {
- return new Promise((resolve, reject) => {
- uni.getUserInfo({
- success: loginRes => {
- this.data.encryptData = loginRes.encryptedData,
- this.data.iv = loginRes.iv
- resolve(this.data)
- }
- })
- })
- },
- //获取微信登录的code码
- getmsg() {
- if (this.isLoginOff) {
- uni.switchTab({
- url: '/pages/my/my'
- })
- } else {
- uni.login({
- provider: uni.$u.platform,
- success: res => {
- this.getCode().then((data) => {
- const params = {
- code: res.code,
- iv: data.iv,
- encryptData: data.encryptData
- }
- console.log(params);
- this.$api.my.myLogin(params).then(res => {
- if(res.code == 0){
- let {
- token
- } = res.data
- this.handleGetWechatUserInfo()
- // this.handleConfirmWechatUserInfo()
- this.$store.dispatch('user/token', token)
- }else{
- uni.showToast({
- icon:'none',
- title:res.msg
- })
- }
- })
- })
- }
- })
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- $pageColor:#F9F9F9;
- $bgColor:#FFFFFF;
- .youyue {
- height: 100%;
- background: $bgColor;
- padding: 0rpx 30rpx 140rpx 30rpx;
- position: relative;
- }
- .userinfo {
- position: absolute;
- top: 38rpx;
- left: 200rpx;
- .unlogin {
- width: 220rpx;
- font-size: 44rpx;
- font-family: PingFang-SC-Heavy, PingFang-SC;
- font-weight: 500;
- color: #FFFFFF;
- display: block;
- margin-top: 20rpx;
- }
- .username {
- width: 184rpx;
- height: 44rpx;
- font-size: 44rpx;
- font-family: PingFang-SC-Heavy, PingFang-SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 44rpx;
- display: block;
- margin-bottom: 24rpx;
- }
- .userId {
- font-size: 32rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 32rpx;
- }
- }
- .nav {
- position: absolute;
- top: 0rpx;
- left: 0rpx;
- image {
- width: 750rpx;
- height: 142rpx;
- }
- }
- .title {
- width: 400rpx;
- height: 120rpx;
- font-size: 44rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #333333;
- line-height: 60rpx;
- margin-bottom: 64rpx;
- }
- .detail {
- width: 690rpx;
- height: 220rpx;
- margin-bottom: 64rpx;
- text {
- font-size: 32rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #333333;
- }
- }
- .item {
- margin: 40rpx 0;
- .itemtitle {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #333333;
- }
- }
- .itemLast {
- width: 690rpx;
- font-size: 24rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #333333;
- margin-bottom: 64rpx;
- }
- .btn {
- width: 688rpx;
- height: 92rpx;
- background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 12rpx;
- text {
- font-size: 30rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #FFFFFF;
- }
- }
- .logintitle {
- height: 40rpx;
- width: 690rpx;
- margin-top: 64rpx;
- margin-bottom: 64rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .line {
- width: 240rpx;
- height: 2rpx;
- background: #EDEDED;
- border-radius: 1rpx;
- }
- .logintype {
- position: relative;
- top: -8rpx;
- text {
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #333333;
- }
- }
- }
- .typebtn {
- display: flex;
- align-items: center;
- justify-content: space-around;
- .item {
- width: 140rpx;
- height: 156rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- image {
- width: 104rpx;
- height: 104rpx;
- margin-bottom: 12rpx;
- }
- text {
- display: block;
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #666666;
- }
- }
- }
- .boxitem {
- border-top: #F0F0F0 2rpx solid;
- border-bottom: #F0F0F0 2rpx solid;
- padding: 40rpx 0;
- position: relative;
- image {
- top: 35%;
- right: 0rpx;
- width: 96rpx;
- height: 96rpx;
- position: absolute;
- }
- .boxitemtitle {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #333333;
- }
- .boxitemcontent {
- margin-top: 24rpx;
- width: 512rpx;
- display: block;
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #333333;
- }
- }
-
- //登录弹框
- .popup-login {
- width: 100%;
- height: 706rpx;
- background: #FFFFFF;
- box-shadow: 0rpx -10rpx 32rpx 0px rgba(0, 0, 0, 0.04);
- border-radius: 16rpx 16rpx 0px 0px;
- padding: 40rpx 64rpx 92rpx;
-
- .popup-login-top {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- font-size: 30rpx;
- font-weight: bold;
- color: #000000;
- }
-
- .popup-login-main {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 62rpx;
-
- .avatar {
- width: 176rpx;
- height: 176rpx;
- border-radius: 50%;
- border: 0;
- background: transparent;
-
- &::after {
- border: none;
- }
-
- .user-avatar {
- object-fit: cover;
- object-position: center;
- }
- }
- }
-
- .popup-login-ipt {
- width: 100%;
- height: 88rpx;
- background: #F6F6F6;
- border-radius: 44rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 48rpx;
-
- .avatar {
- width: 100%;
- height: 100%;
- text-align: center;
- font-size: 28rpx;
- font-weight: bold;
- color: #999999;
- }
-
- }
-
- .popup-login-btn {
- width: 100%;
- height: 88rpx;
- background: #1AAC1B;
- border-radius: 38rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 32rpx;
-
- .confirm {
- border: 0;
- background: transparent;
- font-size: 28rpx;
- font-weight: bold;
- color: #FFFFFF;
-
- &::after {
- border: none;
- }
- }
- }
-
- .popup-login-text {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 32rpx;
- font-weight: bold;
- color: #999999;
- font-size: 22rpx;
- }
- }
-
-
-
- </style>
|