123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <script>
- import {
- getGoodsTypeObj,
- getUserDetail
- } from '@/api/common.js';
- import {getVipLog,mealList,getTmpVip} from '@/api/combo.js'
- import {Test} from '@/utils/tool.js';
- export default {
- onLaunch: function() {
- console.log('App Launch')
-
-
- },
- onShow: function() {
- console.log('App Show')
- // if(uni.getStorageSync('token')){
-
- // getVipLog().then(res=>{
- // console.log(res);
- // if(res.content&&!res.content.length){
- // uni.showModal({
- // title:'提示',
- // content:'免费领取7天会员,畅享专属权益,点击“领取”体验!',
- // cancelText:'取消',
- // confirmText:'领取',
- // success: function (r) {
- // if (r.confirm) {
- // console.log('用户点击确定');
- // mealList({source:2}).then(result=>{
- // if(result.content.records.length){
- // getTmpVip(result.content.records[0].setMealCode).then(res1=>{
- // if(res1.state == 'Success'){
- // uni.showToast({
- // title:'领取成功',
- // icon:'none'
- // })
- // }
- // })
- // }else{
- // uni.showToast({
- // title:'未配置临时会员',
- // icon:'none'
- // })
- // }
- // })
- // }
- // }
- // })
- // }
- // })
- // }
- // 获取商品类型字段
- // getGoodsTypeObj().then(res => {
- // if (res.state == 'Success') {
- // uni.setStorageSync('goodsTypeObj',JSON.stringify(res.content))
- // }
- // })
- },
- onHide: function() {
- console.log('App Hide')
- // 解决我的页面多个登录窗堆叠问题
- let pages = getCurrentPages()
- let currentPage = pages[pages.length - 1]
- if(currentPage.route == 'pages/my/index'){
- uni.reLaunch({
- url:'/pages/index/index'
- })
- }
- },
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import "@/uni_modules/uview-ui/index.scss";
- .tag1{
- display: inline-block;
- width: 70rpx;
- height: 24rpx;
- line-height: 24rpx;
- text-align: center;
- background: #E4F5FF;
- border-radius: 4rpx 4rpx 12rpx 4rpx;
- font-size: 16rpx;
- color: #222222;
- margin-left: 8rpx;
- }
-
- .tag2{
- display: inline-block;
- width: 70rpx;
- height: 24rpx;
- line-height: 24rpx;
- text-align: center;
- background: #FAEBFF;
- border-radius: 4rpx 4rpx 12rpx 4rpx;
- font-size: 16rpx;
- color: #222222;
- margin-left: 8rpx;
- }
-
- .tag3{
- display: inline-block;
- width: 70rpx;
- height: 24rpx;
- line-height: 24rpx;
- text-align: center;
- background: linear-gradient( 180deg, #272624 0%, #FFE1A5 100%);
- border-radius: 4rpx 4rpx 12rpx 4rpx;
- font-size: 16rpx;
- color: #FFE1A5;
- margin-left: 8rpx;
- }
- </style>
|