123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790 |
- <template>
- <view class="my">
- <view class="login">
- <view class="head" v-if="isLogin">
- <view class="img">
- <image :src="info.cIcon" alt=""></image>
- </view>
- <view class="login_title">{{info.cNickName}}</view>
- </view>
- <view class="head" v-else>
- <view class="img" @click="login">
- <image
- src="https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132"
- alt=""></image>
- </view>
- <view class="login_title" @click="login">
- 去登录
- </view>
- </view>
- <view class="balance">
- <view class="money_box">
- <view class="title">
- 账户余额
- </view>
- <text>¥</text>
- {{dBalance}}
- </view>
- <view class="btn_box">
- <view class="btn" @click="goPay">
- 去充值
- </view>
- </view>
- </view>
- </view>
- <view class="account">
- <view class="other">
- <view class="option" @click="gocollect">
- <view class="left">
- <image src="../../static/other/collect.png" mode=""></image>
- </view>
- <view class="right">
- <view class="top">
- 我的收藏
- </view>
- <view class="bottom">
- <text>
- {{collectNum}}
- </text>人
- </view>
- </view>
- </view>
- <view class="option" @click="goCoupon">
- <view class="left">
- <image src="../../static/other/coupon.png" mode=""></image>
- </view>
- <view class="right">
- <view class="top">
- 我的优惠券
- </view>
- <view class="bottom">
- <text>
- {{couponNum}}
- </text>张
- </view>
- </view>
- </view>
- <!-- <view class="option" @click="goCoupon">
- 我的优惠券
- <text>
- {{couponNum}}
- </text>张
- </view> -->
- </view>
- </view>
- <view class="feature">
- <view class="title">
- 通用功能
- </view>
- <view class="box">
- <view class="item" @click="goremamber">
- <image src="../../static/other/address.png" alt=""></image>
- <view>地址管理</view>
- </view>
- <view class="item" @click="goTeamwork">
- <image src="../../static/other/feedback.png" alt=""></image>
- <view>招商合作</view>
- </view>
- <!-- <view class="item" @click="goEngineer" v-if="check == 0 || check == 2 || check == -1"> -->
- <view class="item" @click="goEngineer">
- <image src="../../static/other/home.png" alt=""></image>
- <view>商户入驻</view>
- </view>
- <view class="item" @click="goEngineerCenter">
- <image src="../../static/other/personal.png" alt=""></image>
- <view>商户中心</view>
- </view>
- <view class="item" @click="goComplaint">
- <image src="../../static/other/complain.png" alt=""></image>
- <view>投诉举报</view>
- </view>
- </view>
- </view>
- <view class="popup">
- <u-mask :show="show" @click="show = false">
- <view class="refuse">
- <view class="title">
- 退回提示
- </view>
- <view class="content">
- {{reasonRefusal}}
- </view>
- <view class="btn_box" @click="show = false">
- <view class="btn">
- 取消
- </view>
- <view class="btn success" @click="update">
- 去修改
- </view>
- </view>
- </view>
- </u-mask>
- </view>
- </view>
- </template>
- <script>
- import {
- wxGetCode
- } from '../../api/my'
- import {
- getInfo,
- engineDetail,
- getCoupon,
- getwxQrCode,
- getCollect,
- logout
- } from '../../api/index.js'
- // import { wxLogin } from 'uni-login';
- export default {
- data() {
- return {
- show: false,
- info: [],
- check: -1,
- data: '',
- dBalance: 0,
- txShow: false,
- couponNum: 0, //优惠券数量
- isQrcodeShow: false,
- qrcodeImage: '',
- urlView: '',
- qqUrl: '',
- cnickName: '',
- wx_copenid: '', //微信返回openid
- token: '', //登录成功token
- isLogin: false,
- collectNum: 0,
- reasonRefusal: ''
- }
- },
- methods: {
- goTeamwork() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: '../join/teamwork'
- })
- }
- },
- goComplaint() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: '../join/feedback'
- })
- }
- },
- //获取收藏列表
- getcollectList() {
- var data = {
- cWxOpenId: uni.getStorageSync('wx_copenid')
- }
- getCollect(data).then(res => {
- if (res.data.code == 200) {
- this.collectNum = res.data.data.length
- // this.list = res.data.data
- }
- })
- },
- goWithdraw() {
- uni.navigateTo({
- url: './withdraw'
- })
- },
- goFeedBack() {
- },
- // },
- qrCodeShow() {
- this.isQrcodeShow = !this.isQrcodeShow
- },
- getwxQrCode() {
- var openId = {
- openId: uni.getStorageSync('wx_copenid')
- }
- getwxQrCode(openId).then(res => {
- let TICKET = res.data.ticket
- this.urlView = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' + TICKET
- })
- },
- //跳转至优惠券页
- goCoupon() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: './coupon'
- })
- }
- },
- //跳转至商户中心页
- goEngineerCenter() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: './engineerCenter'
- })
- }
- },
- //商户入驻
- goEngineer() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- if (this.check == 0 || this.check == 2 || this.check == 3) {
- uni.showToast({
- title: '正在审核中',
- icon: 'none'
- })
- return
- } else if (this.check == 1) {
- uni.showToast({
- title: '审核已通过',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: '/pages/join/first_join'
- })
- }
- }
- },
- update() {
- uni.navigateTo({
- url: './indent?title=编辑资料'
- })
- },
- //跳转至充值
- goPay() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: '../my/pay'
- })
- }
- },
- //跳转至我的收藏
- gocollect() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: './collect'
- })
- }
- },
- login() {
- uni.navigateTo({
- url: '../login/wxLogin'
- })
- },
- goremamber() {
- if (!this.isLogin) {
- uni.showToast({
- title: '请登录',
- icon: 'none'
- })
- return
- } else {
- uni.navigateTo({
- url: './remember'
- })
- }
- },
- myCoupon() {
- var openId = {
- openid: uni.getStorageSync('wx_copenid')
- }
- getCoupon(openId).then(res => {
- if (res.data.data.length > 0) {
- this.couponNum = res.data.data.length
- } else {
- this.couponNum = 0
- }
- })
- },
- getinfo() {
- getInfo().then(res => {
- if (res.data.code == 200) {
- this.isLogin = true
- this.info = res.data.data,
- this.dBalance = res.data.data.dBalance.toFixed(2)
- } else {
- this.isLogin = true
- }
- // uni.setStorage({
- // key: 'wx_copenid',
- // data: res.data.data.cOpenid
- // })
- // this.check = res.data.data.role
- // if (res.data.data.role == 1) {
- // this.txShow = true
- // }
- })
- },
- getDetails() {
- var openid = {
- cOpenId: uni.getStorageSync('wx_copenid')
- }
- engineDetail(openid).then(res => {
- if (res.data.data) {
- this.check = res.data.data.nTong
- this.reasonRefusal = res.data.data.reasonRefusal
- this.data = res.data.data
- if (this.check == 1) {
- this.txShow = true
- }
- } else {
- this.check = -1
- }
- })
- },
- //退出登录
- logout() {
- uni.showModal({
- title: '确定退出登录吗',
- success: (res) => {
- if (res.confirm) {
- logout().then(res => {
- if (res.data.code == 200) {
- // this.getinfo()
- uni.removeStorageSync('access-token')
- this.$router.go(0)
- uni.showToast({
- title: '已退出登录',
- icon: 'none'
- })
- }
- })
- } else if (res.cancel) {
- return
- }
- }
- })
- }
- },
- onLoad() {
- this.wx_copenid = uni.getStorageSync('wx_copenid')
- uni.setStorageSync('access-token','eyJhbGciOiJIUzUxMiJ9.eyJ0ZjoiOiIwMTU2MTZiNS0xNjdmLTQ3YTEtODVmOC0xMWYxNzJiNzA5ZmUifQ._21anlHblpwT97QZ7t2c_aH3VD79CjnP4_LHjgXjF7-GqXVk1U9RtnZlGYAwhe91I_eqCB8ZWY1Gn3R5zk28jw')
- uni.setStorageSync('wx_copenid','o7Txd6poqpr0ZJUOsAudwJgoNutw')
- },
- onShow() {
- this.getinfo()
- this.myCoupon()
- this.getDetails()
- this.getcollectList()
- // this.getwxQrCode()
- }
- }
- </script>
- <style lang="scss" scoped>
- .my {
- background: #F7F8FA;
- width: 100vw;
- height: 100vh;
- position: relative;
- .popup {
- .refuse {
- width: 60%;
- height: 200px;
- background-color: #fff;
- border-radius: 10px;
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- padding: 20px;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- .title {
- width: 100%;
- height: 10%;
- text-align: center;
- color: #808080;
- }
- .content {
- flex: 1;
- overflow-y: auto;
- margin-bottom: 10px;
- margin-top: 10px;
- }
- .btn_box {
- width: 100%;
- height: 10%;
- display: flex;
- justify-content: space-around;
- font-size: 24rpx;
- .btn {
- width: 30%;
- height: 25px;
- background-color: #c8c9cc;
- text-align: center;
- line-height: 25px;
- border-radius: 5px;
- }
- .success {
- background: linear-gradient(to right, #35c99d, #27aea7);
- color: #fff;
- }
- }
- }
- }
- }
- .title {
- width: 100%;
- padding-bottom: 20rpx;
- .titles {
- text-align: center;
- font-size: 36rpx;
- font-family: Georgia, 'Times New Roman', Times, serif;
- font-weight: bold;
- padding-top: 10rpx;
- }
- .back {
- position: absolute;
- left: 30rpx;
- width: 80rpx;
- height: 35rpx;
- image {
- width: 18rpx;
- height: 100%;
- }
- }
- }
- .login {
- width: 100%;
- height: 484rpx;
- box-sizing: border-box;
- // background-image: url(../../static/other/bgi.png);
- background-image: url(../../static/other/bgimg.png);
- background-repeat: no-repeat;
- background-size: 100% 100%;
- position: relative;
- .head {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding-top: 52rpx;
- .img {
- width: 160rpx;
- height: 160rpx;
- border-radius: 100px;
- overflow: hidden;
- margin-bottom: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .login_title {
- font-weight: 700;
- margin-left: 20rpx;
- }
- }
- .balance {
- width: 670rpx;
- height: 188rpx;
- position: absolute;
- bottom: -32rpx;
- left: 50%;
- transform: translateX(-50%);
- background: linear-gradient(292deg, #3A3532 0%, #222021 100%);
- border-radius: 24px 24px 24px 24px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 48rpx;
- box-sizing: border-box;
- font-size: 48rpx;
- color: #FFE6CE;
- .money_box {
- color: #FFE6CE;
- .title {
- padding: 0;
- font-size: 24rpx;
- margin-bottom: 16rpx;
- }
- text {
- font-size: 28rpx;
- }
- }
- .btn_box {
- display: flex;
- align-items: center;
- .btn {
- color: #000;
- width: 148rpx;
- height: 72rpx;
- font-size: 28rpx;
- background: linear-gradient(to bottom, #ead3ba, #ddbe96);
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 20px;
- // margin-left: 200rpx;
- }
- }
- }
- image {
- width: 108rpx;
- height: 108rpx;
- }
- .text {
- flex: 1;
- font-size: 36rpx;
- color: #1A1A1A;
- font-family: monospace;
- font-weight: bold;
- margin-left: 40rpx;
- }
- .login_out {
- // margin-left: 100;
- width: 50rpx;
- height: 50rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .my_list {
- // position: fixed;
- bottom: 0;
- width: calc(100% - 60rpx);
- height: 60vh;
- border-top-left-radius: 30rpx;
- border-top-right-radius: 30rpx;
- padding: 0 30rpx;
- padding-top: 50rpx;
- display: flex;
- justify-content: space-around;
- .item {
- height: 100rpx;
- line-height: 100rpx;
- position: relative;
- text-align: center;
- image {
- width: 80rpx;
- height: 80rpx;
- }
- view {
- font-size: 26rpx;
- color: #707678;
- height: 30rpx;
- line-height: 30rpx;
- }
- }
- }
- .account {
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- margin: 62rpx auto;
- .other {
- width: 100%;
- padding: 0px 40rpx;
- // border-radius: 20rpx 20rpx 0px 0px;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- // padding: 10rpx 0px 10rpx 0px;
- // background-color: #fff;
- .option {
- width: 319rpx;
- height: 136rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- display: flex;
- align-items: center;
- font-weight: 700;
- padding: 24rpx 32rpx;
- box-sizing: border-box;
- .left {
- image {
- width: 88rpx;
- height: 88rpx;
- }
- }
- .right {
- margin-left: 24rpx;
- .top {
- font-size: 28rpx;
- color: #2F3437;
- margin-bottom: 10rpx;
- }
- .bottom {
- font-size: 24rpx;
- color: #5E686E;
- text {
- font-size: 26rpx;
- color: #03C8BE;
- }
- }
- }
- }
- }
- .money {
- font-size: 40rpx;
- }
- .btn {
- color: #eddbc5;
- }
- }
- .feature {
- width: 670rpx;
- padding: 32rpx;
- background-color: #fff;
- border-radius: 10px;
- box-sizing: border-box;
- margin: 30rpx auto;
- .title {
- font-weight: 700;
- font-size: 28rpx;
- color: #2F3437;
- }
- .box {
- display: flex;
- flex-wrap: wrap;
- .item {
- width: 25%;
- margin: 20rpx 0px;
- display: flex;
- flex-direction: column;
- align-items: center;
- font-size: 24rpx;
- color: #2F3437;
- image {
- width: 60rpx;
- height: 60rpx;
- margin-bottom: 8rpx;
- }
- }
- }
- }
- .qr_code {
- width: 100vw;
- height: 100vh;
- background-color: rgba(0, 0, 0, 0.8);
- z-index: 999999;
- position: absolute;
- top: 0;
- left: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- .img_box {
- background-color: #fff;
- // height: 800rpx;
- border-radius: 20rpx;
- overflow: hidden;
- image {
- width: 400rpx;
- height: 400rpx;
- }
- }
- }
- </style>
|