123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 |
- <template>
- <view class="memberCenter">
- <zs-header title="会员中心" :background="background"></zs-header>
- <view class="top-box target" :style="{backgroundImage:`url(${list[current].backImg})`}">
- <view class="user-info">
- <image class="image" :src="userInfo.imgPath || defaultImg" lazy-load mode=""></image>
- <view class="info">
- <view class="user-name" :style="{color:`${list[current].backColour}`}">{{userInfo.nickname ||'用户'}}</view>
- <view class="tel">{{currentLevelName ||'您当前未开通会员'}}</view>
- </view>
- </view>
- <view class="swiper-box">
- <image v-if="current!=0" class="click left" src="../../static/member/click.gif" mode=""></image>
- <image v-if="current!=list.length-1" class="click" src="../../static/member/click.gif" mode=""></image>
- <swiper @change="changeSwiper" :current="current" class="swiper"
- >
- <swiper-item class="swiper-item" v-for="(item,index) in list" :key="item.setMealCode">
- <view class="content">
- <view :style="{background:item.backColour,color:item.colour}" v-if="userInfo.setMealCode == item.setMealCode" class="tag">
- 当前等级
- </view>
- <image class="icon" :src="item.imgUrl" mode=""></image>
- <!-- <view class="price" :style="{color:item.color}">
- {{`开通会员${item.price}/月`}}
- </view>
- <view class="notice" :style="{color:item.color}">
- 开通会员预计节省 <text class="num">¥99元</text>
- </view> -->
- </view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <view v-if="list1.length">
- <view class="title-box">
- <view class="title">
- 基础权益
- </view>
- </view>
- <u-grid :border="false" col="3">
- <u-grid-item v-for="(item,d) in list1" :key="d">
- <image class="icon" :src="item.equityImg" mode=""></image>
- <text class="title">{{item.equityName}}</text>
- <text class="desc">{{item.equityDetail}}</text>
- </u-grid-item>
- </u-grid>
- </view>
-
- <view v-if="list2.length">
- <view class="title-box">
- <view class="title">
- 专属权益
- </view>
- </view>
-
- <u-grid :border="false" col="3">
- <u-grid-item v-for="(item,d) in list2" :key="d" @click="openPop(item)">
- <image class="icon" :src="item.equityImg" mode=""></image>
- <text class="title">{{item.equityName}}</text>
- <text class="desc">{{item.equityDetail}}</text>
- </u-grid-item>
- </u-grid>
- </view>
- <!--
- <view class="title-box">
- <view class="title">
- 娱乐
- </view>
- <view class="desc">
- 享受多达24种娱乐权益
- </view>
- </view>
-
- <u-grid :border="false" col="3">
- <u-grid-item v-for="(item,listIndex) in list1" :key="listIndex">
- <image class="icon" :src="item.icon" mode=""></image>
- <text class="title">{{item.title}}</text>
- <text class="desc">{{item.desc}}</text>
- </u-grid-item>
- </u-grid> -->
- <view class="fixed-box">
- <view class="btn-box">
- <view class="left-box" @click="handleCall">
- <image class="icon" src="../../static/phone.png" mode=""></image>
- <view class="info">
- <view class="tel">
- 10086
- </view>
- <view class="desc">
- 套餐咨询
- </view>
- </view>
- </view>
- <button class="btn" v-if="cmVipEnable&&userInfo.setMealCode != currentMeal" :loading="btnLoading" @click="goOrder">
- 立即开通
- </button>
- </view>
- <view class="agreement-box" v-if="cmVipEnable&&userInfo.setMealCode != currentMeal">
- <u-checkbox-group size="28rpx" v-model="checked" @change="choose">
- <u-checkbox activeColor="#EE4320" shape="circle" name="1" ></u-checkbox>
- </u-checkbox-group>
- <view class="text">
- 已阅读并同意 <text class="color" @click="jump('/agreement/member')">《慧研学惠生活基础会员服务协议》</text>
- </view>
- </view>
-
- </view>
-
-
- <u-popup :show="show" round="32rpx" mode="bottom" @close="show = false">
- <view class="discounts-title">
- 权益领取
- </view>
- <view class="discounts">
- <view class="discounts-item" v-if="type == 2">
- <view class="type-box">
- <view class="price">
- {{item | filterPrice}}
- </view>
- <view class="type">
- {{item | filterType}}
- </view>
- </view>
- <view class="info">
- <view class="card-title">
- {{item.couponName}}
- </view>
- <!-- <view class="limit">
- {{item.useStartTime}}后可用
- </view> -->
-
- <view class="desc">
- {{item.usrDetail || '-'}}
- </view>
- </view>
- <view class="btn" :class="[item.exist > 0?'used':'']" @click="handleBuy(item.id,item.exist)">
- {{item.exist > 0?'已领取':'领取'}}
- </view>
- </view>
-
- <view class="box" v-else-if="type == 4">
- <view class="item" v-for="(i,d) in item.equityContent" :key="d">
- <image class="icon" :src="i.icon" mode=""></image>
- <view class="title">
- {{i.equityName}}
- </view>
- <view class="btn" @click="handle(i)">
- {{i.canClaim?'领取':'查看'}}
- </view>
- </view>
- </view>
-
- <view class="desc-box">
-
- <view class="sub-title" v-if="item.equityMsg">
- 权益说明
- </view>
- <!-- <rich-text class="desc" :nodes="item.equityMsg"></rich-text> -->
- <view class="desc" v-html="item.equityMsg">
- {{item.equityMsg}}
- </view>
- </view>
-
-
-
- </view>
- </u-popup>
-
- <u-popup :show="show1" round="32rpx" mode="bottom" @close="show1 = false">
- <view class="discounts-title">
- 权益领取手机号
- </view>
- <view class="account-box">
- <!-- <u--input
- class="account-input"
- placeholder="请输入充值账号"
- border="none"
- cursorSpacing="150rpx"
- v-model.trim="form.account"
- ></u--input> -->
- <input class="account-input" v-model.trim="form.account" placeholder="请输入充值账号" border="none" />
- <button class="btn" :loading="btnLoading1" :disabled="btnLoading1" @click="getMediaVipCoupon">
- 确认
- </button>
- </view>
-
- </u-popup>
-
- <web-view v-if="H5url" :src="H5url"></web-view>
- </view>
- </template>
- <script>
- import {getSetting} from '@/api/common.js'
- import {mealList,equityList,getH5url,getVideoEquity,getMediaVipCoupon} from '@/api/combo.js'
- import {getXiaojuCoupon,getCouponDetail} from '@/api/coupon.js'
-
- export default {
- data() {
- return {
- type:0,
- cmVipEnable:false,
- checked:'',
- current: 0,//轮播套餐index
- currentMeal: 0,//套餐id
- background: false,
- defaultImg: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fci.xiaohongshu.com%2Fc34b7b74-ba38-0456-982a-43c0f97522fe%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fci.xiaohongshu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1693532127&t=a2e186c12aecaab7723611cb52a6778f',
- userInfo: {
- imgPath: "",
- isAuth: 1,
- lastLogin: "",
- nickname: "",
- openId: "",
- phoneNum: "",
- score: 0,
- setMealId: 0,
- sex: 1,
- userId: "",
- },
- list: [{backImg:''}],
- list1:[],
- list2:[],
- query:{
- "channelCode": "",
- "channelType": "",
- "discount": 6,
- "extension": "test",
- "phone": "",
- "saleModalId": ""
- },
- form:{
- account:JSON.parse(uni.getStorageSync('userInfo')).phoneNum
- },
- H5url:'',
- btnLoading:false,
- btnLoading1:false,
- currentMealCode:0,
- show:false,
- show1:false,
- item:{},
- equityId:0,
- equityContentId:0,
- productId:0
- }
- },
- computed: {
- currentLevelName() {
- let list = this.list.filter(item=>{
- if(item.setMealCode == this.userInfo.setMealCode){
- return item
- }
- })
- if(list.length){
- return list[0].setMealName
- }else{
- return ''
- }
- }
- },
- filters: {
- filterPrice: function(val) {
- if(val.couponType == 1){
- return `¥${val.couponDiscount}`
- }else if(val.couponType == 2){
- return `${val.couponDiscount}折`
- }else if(val.couponType == 3){
- return `¥${val.couponDiscount}`
- }
- },
- filterType: function(val) {
- if(val.couponType == 1){
- if(val.couponCondition){
- return `满${val.couponCondition}立减`
- }else{
- return '无门槛立减'
- }
- }else if(val.couponType == 2){
- if(val.couponCondition){
- return `满${val.couponCondition}`
- }else{
- return '无门槛立减'
- }
- }else if(val.couponType == 3){
- if(val.couponCondition){
- return `满${val.couponCondition}立减`
- }else{
- return '无门槛立减'
- }
- }
- },
- },
- methods: {
- handle(item){
- if(item.canClaim){
- this.show = false
- this.show1 = true
- this.equityContentId = item.id
- this.productId = item.serviceId
- this.form.account = JSON.parse(uni.getStorageSync('userInfo')).phoneNum
- }else{
- uni.navigateTo({
- url:'./logList'
- })
- }
- },
- handleCall() {
- uni.makePhoneCall({
- phoneNumber: '10086' //仅为示例
- });
-
- },
- openPop(item){
- console.log(item);
- if(this.userInfo.setMealCode != item.setMealCode) return uni.showToast({
- title:'不是当前会员',
- icon:'none'
- })
- this.type = item.bindService
- if(item.bindService == 2){//加油券
- this.show = true
- getCouponDetail({id:item.bindContent}).then(res=>{
- if(res.state == 'Success'){
- this.item = res.content
- this.item.equityMsg = item.equityMsg.replaceAll('\n','<br/>')
- }
- })
- }else if(item.bindService == 4){//视频会员
- this.show = true
- this.equityId = item.id
- getVideoEquity({equityId:item.id}).then(res=>{
- if(res.state == 'Success'){
- this.item = res.content
- this.item.equityContent = JSON.parse(this.item.equityContent)
- this.item.equityMsg = item.equityMsg.replaceAll('\n','<br/>')
- }
- })
- }else if(item.bindService == 5){//抽奖
- uni.navigateTo({
- url:'/luckyDraw/index?id='+item.bindContent
- })
- }else if(item.equityName.indexOf('领水')!=-1){
- uni.navigateTo({
- url:'/special/water'
- })
- }
- },
- // 点击领取
- handleBuy() {
- uni.showLoading({
- title:'领取中'
- })
- getXiaojuCoupon({activityXiaojuId:this.item.activityXiaojuId,userId:JSON.parse(uni.getStorageSync('userInfo')).userId,mobile:JSON.parse(uni.getStorageSync('userInfo')).phoneNum}).then(res=>{
- uni.hideLoading()
- if(res.state == 'Success'){
- uni.showToast({
- title:'领取成功',
- icon:'success'
- })
- }
- })
-
-
- },
- getMediaVipCoupon(){
- this.btnLoading1 = true
- let userInfo = JSON.parse(uni.getStorageSync('userInfo'))
- getMediaVipCoupon({
- productId:this.productId,
- accountType:1,
- equityContentId:this.equityContentId,
- "equityId": this.equityId,
- "userId": userInfo.userId,
- userMobile:userInfo.phoneNum,
- mobile:this.form.account}).then(res=>{
- this.btnLoading1 = false
- if(res.state == 'Success'){
- this.show1 = false
- uni.showToast({
- title:'领取成功',
- icon:'success'
- })
- }
- })
- },
- jump(url){
- uni.navigateTo({
- url
- })
- },
- choose(val){
- console.log(val);
- },
- goOrder(){
- if(!this.checked.length) return uni.showToast({
- title:'请勾选会员服务协议',
- icon:'none'
- })
- if(this.btnLoading) return
- this.query.saleModalId = this.list[this.current].setMealCode
- // this.H5url = 'http://iot-pay-server.dev.zonelife.cn/app-h5/task/dist/index.html#/localLife/orderResult?businessName=%E7%A0%94%E5%AD%A620%E5%85%83%E5%8C%85&lifeId=fcbfbb7ea3ada89ad160da82dc9c75e6'
- this.getH5url()
- },
- changeSwiper(val) {
- this.current = val.target.current
- this.currentMeal = this.list[val.target.current].setMealCode
- this.query.discount = this.list[val.target.current].discount
- this.equityList(this.currentMeal,1)
- this.equityList(this.currentMeal,2)
-
- },
- mealList(){
- return new Promise((resolve,reject)=>{
- mealList({currentPage:1,pageSize:99,status:1}).then(res=>{
- if (res.state == 'Success') {
- this.list = res.content.records
- this.list.map((item,index)=>{
- if(this.userInfo.setMealCode == item.setMealCode){
- this.current = index
- }
- })
-
- this.currentMeal = this.list[this.current].setMealCode
- this.query.discount = this.list[this.current].discount
- resolve(this.currentMeal)
- }
- })
- })
- },
- equityList(setMealCode,equityType){
- return new Promise((resolve,reject)=>{
- equityList({currentPage:1,pageSize:99,setMealCode,equityType,status:1,showType:1}).then(res=>{
- if (res.state == 'Success') {
- this['list'+equityType] = res.content.records
- resolve(setMealCode)
- }
- })
- })
- },
- getData(){
- this.mealList().then(id=>{
- return this.equityList(id,1)
- }).then(id1=>{
- this.equityList(id1,2)
- })
- },
- getH5url(){
- this.btnLoading = true
- getH5url(this.query).then(res=>{
- this.btnLoading = false
- if (res.state == 'Success') {
- this.H5url = res.content
- }
- })
- },
- getSetting(){
- getSetting().then(res=>{
- if(res.state == 'Success'){
- this.cmVipEnable = res.content.cmVipEnable
- }
- })
- }
-
- },
- onPageScroll(e) {
- if (e.scrollTop >= 50) {
- this.background = true
- } else {
- this.background = false
- }
- },
- created() {
- if(uni.getStorageSync('userInfo')) {
- this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
- this.query.phone = this.userInfo.phoneNum
- }
- // this.current = this.userInfo.setMealId
- this.getData()
- },
- onLoad(options) {
- this.getSetting()
- console.log('onload',options);
- }
- }
- </script>
- <style lang="scss">
- .memberCenter {
- min-height: 100vh;
- background: #FFF;
- padding-bottom: 180rpx;
- .swiper-box{
- position: relative;
- .click{
- position: absolute;
- top: calc(50% - 25rpx) ;
- right: 0;
- width: 100rpx;
- height: 100rpx;
- z-index: 999;
- }
- .click.left{
- left: 0;
- transform: rotateY(180deg);
- }
- .swiper {
- width: 750rpx !important;
- height: 272rpx !important;
- position: relative;
- left: -30rpx;
- top: 20rpx;
- }
- .swiper-item {
- width: 640rpx !important;
- height: 272rpx !important;
- position: relative;
- padding: 0 55rpx;
- .active {
- // transform: scale(1) !important;
- }
- .content {
- // transform: scale(.9);
- // transition: transform .3s;
- // transform-origin: center center;
- .icon {
- width: 640rpx;
- height: 272rpx;
- border-radius: 16rpx;
- }
- .tag {
- width: 104rpx;
- height: 34rpx;
- line-height: 34rpx;
- text-align: center;
- font-size: 22rpx;
- color: #fff;
- border-radius: 16rpx 0rpx 16rpx 0rpx;
- position: absolute;
- top: 0%;
- left: 55rpx;
- z-index: 2;
- }
- .price {
- font-size: 24rpx;
- position: absolute;
- left: 95rpx;
- top: 140rpx;
- }
- .notice {
- font-size: 24rpx;
- position: absolute;
- left: 95rpx;
- bottom: 40rpx;
- .num {
- font-weight: bold;
- font-size: 36rpx;
- }
- }
- }
- }
- }
- .top-box {
- width: 750rpx;
- height: 600rpx;
- padding: 150rpx 30rpx 0;
- box-sizing: border-box;
- position: relative;
- background-size: 100% 495rpx;
- background-repeat: no-repeat;
- .user-info {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 15rpx 0;
- color: #222222;
- .image {
- width: 108rpx;
- height: 108rpx;
- background: #f1f1f1;
- border-radius: 50%;
- }
- .info {
- flex: 1;
- margin-left: 30rpx;
- .user-name {
- font-size: 32rpx;
- font-weight: bold;
- color: #222222;
- }
- .tel {
- font-size: 24rpx;
- margin-top: 10rpx;
- color: #AAAAAA;
- }
- }
- }
- }
- .title-box {
- display: flex;
- align-items: center;
- margin: 30rpx 30rpx 0;
- .title {
- color: #222222;
- font-weight: bold;
- font-size: 32rpx;
- }
- .desc {
- margin-left: 10rpx;
- font-size: 22rpx;
- color: #AAAAAA;
- }
- }
-
- .u-grid{
- .u-grid-item{
- padding-top:30rpx ;
- }
- .icon{
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- }
- .title{
- width: 200rpx;
- font-size: 28rpx;
- color: #222222;
- margin-top: 10rpx;
- text-align: center;
- font-weight: bold;
- }
- .desc{
- width: 150rpx;
- color: #AAAAAA;
- font-size: 20rpx;
- text-align: center;
- }
- }
- .fixed-box {
- position: fixed;
- bottom: 0%;
- left: 0%;
- width: 100%;
- background: #fff;
- padding: 15rpx 20rpx 40rpx;
- box-sizing: border-box;
- .btn-box{
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left-box {
- display: flex;
- align-items: center;
- .icon {
- width: 80rpx;
- height: 80rpx;
- }
- .info {
- margin-left: 20rpx;
- .tel {
- color: #222222;
- font-weight: bold;
- font-size: 32rpx;
- }
- .desc {
- font-size: 22rpx;
- color: #999999;
- }
- }
- }
- .btn {
- width: 340rpx;
- height: 80rpx;
- line-height: 80rpx;
- margin: 0;
- text-align: center;
- background: #FF4C3A;
- color: #fff;
- font-size: 28rpx;
- font-weight: bold;
- border-radius: 40rpx 40rpx 40rpx 40rpx;
- }
- }
-
- .agreement-box{
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 20rpx;
- color: #999999;
- margin-top: 20rpx;
- .color{
- color: #EE4320;
- }
- }
- }
-
- .u-popup__content{
- background: #F6F6F6!important;
- }
-
- .discounts-title {
- font-weight: bold;
- font-size: 32rpx;
- color: #222222;
- // text-align: center;
- padding: 28rpx 24rpx;
- }
- .discounts {
- padding: 0 24rpx 28rpx;
- max-height: 1000rpx;
- min-height: 600rpx;
- overflow: auto;
- .discounts-item {
- margin-bottom: 20rpx;
- display: flex;
- align-items: center;
- background-color: rgb(239, 239, 239);
- background: url('../../static/new-card.png') no-repeat;
- background-repeat: no-repeat;
- background-size: 100% 144rpx;
- border-radius: 16rpx;
- height: 144rpx;
- padding: 0 24rpx;
- box-sizing: border-box;
- .type-box{
- text-align: center;
- .price{
- ont-size: 40rpx;
- color: #FF4D3A;
- }
- .type{
- font-size: 20rpx;
- color: #AAAAAA;
- margin-top: 12rpx;
- }
- }
- .info {
- flex: 1;
- margin-left: 40rpx;
- .card-title {
- font-size: 28rpx;
- color: #222222;
- }
- .desc{
- font-size: 20rpx;
- color: #AAAAAA;
- }
- .limit{
- font-size: 20rpx;
- color: #AAAAAA;
- margin:10rpx 0;
- }
- }
- .btn {
- width: 118rpx;
- height: 48rpx;
- line-height: 48rpx;
- text-align: center;
- font-size: 24rpx;
- background: #EE4320;
- border-radius: 24rpx;
- color: #FFF;
- box-sizing: border-box;
- }
- .btn.used{
- border: 2rpx solid #EE421F;
- color: #EE421F;
- background: none;
- }
- }
- .box{
- border-radius: 16rpx;
- background: #fff;
- .item{
- display: flex;
- align-items: center;
- padding: 28rpx 24rpx;
- .icon{
- width: 160rpx;
- height: 160rpx;
- border-radius: 16rpx;
- }
- .title{
- font-weight: 600;
- font-size: 32rpx;
- color: #222222;
- flex: 1;
- margin-left: 20rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .btn{
- width: 120rpx;
- height: 52rpx;
- text-align: center;
- line-height: 52rpx;
- font-size: 28rpx;
- color: #EE4320;
- background: rgba(238,67,32,0.1);
- border-radius: 26rpx 26rpx 26rpx 26rpx;
- }
- .btn.disable{
- background: #F0F0F0;
- color: #AAAAAA;
- }
- }
- }
- .desc-box{
- border-radius: 16rpx;
- background: #fff;
- padding: 24rpx;
- margin-top: 20rpx;
- .sub-title{
- font-weight: bold;
- font-size: 26rpx;
- color: #222222;
- padding: 0rpx;
- }
- .desc{
- margin-top: 20rpx;
- }
- }
- .sub-title{
- font-weight: bold;
- font-size: 26rpx;
- color: #222222;
- // text-align: center;
- padding: 28rpx 24rpx;
- }
- .desc{
- color: #AAAAAA;
- font-size: 24rpx;
- line-height: 40rpx;
- }
- }
-
- .account-box{
- .account-input,.u-input__content{
- width: 702rpx;
- height: 96rpx;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- margin:0 auto 20rpx;
- box-sizing: border-box;
- padding: 0 20rpx;
-
- }
- .btn{
- width: 702rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- background: #EE4320;
- border-radius: 40rpx;
- font-weight: 600;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- }
- }
- </style>
|