```
<script>
import {
checkLogin
} from "./libs/login";
import {
HTTP_REQUEST_URL
} from './config/app';
import {
getconfig,
history
} from '@/api/public.js'
export default {
globalData: {
spid: 0,
code: 0,
isLogin: false,
userInfo: {},
MyMenus: [],
balance_func_status: 0, //余额开关
recharge_switch: 0, // 充值开关
store_user_min_recharge: 0, //最小充值
yue_pay_status: 0, //余额支付开关
alipay_open: 0, //支付宝支付开关
routine_logo: '', //首页logo
site_logo: '',
site_name: '', //名称
fid: '', //一级分类id
uid: '',
hide_mer_status: 0,
},
onLaunch: function(option) {
console.log(this.$store)
console.log()
this.globalData.uid = this.$store.state.app.uid
let that = this;
// #ifdef MP
if (HTTP_REQUEST_URL == '') {
console.error(
"请配置根目录下的config.js文件中的 'HTTP_REQUEST_URL'\n\n请修改开发者工具中【详情】->【AppID】改为自己的Appid\n\n请前往后台【小程序】->【小程序配置】填写自己的 appId and AppSecret"
);
return false;
}
if (option.query.hasOwnProperty('scene')) {
switch (option.scene) {
//扫描小程序码
case 1047:
console.log(option, 'val')
let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
that.globalData.code = val;
that.globalData.uid = val
break;
//长按图片识别小程序码
case 1048:
that.globalData.code = option.query.scene;
break;
//手机相册选取小程序码
case 1049:
that.globalData.code = option.query.scene;
break;
//直接进入小程序
case 1001:
that.globalData.spid = option.query.scene;
break;
}
}
// #endif
// 获取导航高度;
uni.getSystemInfo({
success: function(res) {
that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
}
});
// 获取配置
getconfig().then(res => {
uni.$emit('update', res.data)
uni.setStorageSync('GLOBAL_DATA', res.data);
this.globalData.balance_func_status = res.data.balance_func_status
this.globalData.recharge_switch = res.data.recharge_switch
this.globalData.routine_logo = res.data.routine_logo
this.globalData.site_logo = res.data.site_logo
this.globalData.login_logo = res.data.login_logo
this.globalData.site_name = res.data.site_name
this.globalData.store_user_min_recharge = res.data.store_user_min_recharge
this.globalData.yue_pay_status = res.data.yue_pay_status
this.globalData.sys_intention_agree = res.data.sys_intention_agree
this.globalData.mer_intention_open = res.data.mer_intention_open
this.globalData.alipay_open = res.data.alipay_open
this.globalData.hide_mer_status = res.data.hide_mer_status
this.globalData.mer_location = res.data.mer_location
try {
uni.setStorageSync('SUBSCRIBE_MESSAGE', res.data.tempid);
} catch (e) {
// error
}
// #ifdef H5
this.setOpenShare(res.data);
// #endif
}).catch(err => {})
},
onShow() {
// 记录H5和公众号
if (this.$store.state.app.token) {
// 浏览记录
// #ifdef H5
history({
page: location.pathname + location.search,
}).then(() => {});
//#endif
}
},
methods: {
// 微信分享;
setOpenShare: function(data) {
let that = this;
let href = location.href;
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this.globalData.uid;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.share_info,
title: data.share_title,
link: href,
imgUrl: data.share_pic
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
}
}
},
onHide: function() {
//console.log('App Hide')
},
watch: {
// 记录H5和公众号
$route(n) {
if (this.$store.state.app.token) {
// 浏览记录
history({
page: location.pathname + location.search,
}).then(() => {});
}
},
}
}
</script>
<style>
@import url("@/plugin/animate/animate.min.css");
@import 'static/css/base.css';
@import 'static/iconfont/iconfont.css';
@import 'static/css/guildford.css';
@import 'static/css/style.scss';
view {
box-sizing: border-box;
}
.bg-color-red {
background-color: #e93323 !important;
}
.syspadding {
padding-top: var(--status-bar-height);
}
.flex {
display: flex;
}
.uni-scroll-view::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
::-moz-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.empty-txt {
line-height: 100rpx;
font-size: 22rpx;
color: #999;
text-align: center;
}
.product-con .conter img {
display: block;
}
.open-location {
height: 100vh;
}
</style>
```
- App.vue
- main.js
- pages.json
- vue.config.js
- uni.scss
- template.h5.html
- sitemap.json
- project.config.json
- package-lock.json
- manifest.json
- .gitignore
- utils
- cache.js
- emoji.js
- index.js
- permission.js
- request.js
- SubscribeMessage.js
- util.js
- validate.js
- store
- index.js
- getters.js
- modules
- app.js
- modules_index.js
- static
- css
- base.css
- guildford.css
- pages
- activity
- assist
- index.vue
- assist_detail
- index.vue
- assist_record
- index.vue
- combination
- index.vue
- combination_details
- index.vue
- combination_poster
- index.vue
- combination_status
- index.vue
- goods_seckill
- index.vue
- goods_seckill_details
- index.vue
- liveBroadcast
- index.vue
- presell
- index.vue
- presell_details
- index.vue
- index.vue
- admin
- delivery
- index.vue
- order
- index.vue
- order_cancellation
- index.vue
- orderDetail
- index.vue
- orderList
- index.vue
- statistics
- index.vue
- auth
- index.vue
- chat
- customer_list
- chat.vue
- index.vue
- columnGoods
- goods_list
- index.vue
- goods_search
- goods_search_con
- index.vue
- HotNewGoods
- index.vue
- error
- index.vue
- first_new_product
- index.vue
- goods_cate
- goods_cate.vue
- goods_details
- index.vue
- index
- index.vue
- news_details
- index.vue
- news_list
- index.vue
- order_addcart
- order_addcart.vue
- order_details
- index.vue
- stay.vue
- order_pay_back
- index.vue
- order_pay_status
- index.vue
- promotional_items
- index.vue
- retrieve_password
- index.vue
- store
- applicationRecord
- index.vue
- detail
- index.vue
- home
- index.vue
- list
- index.vue
- merchantDetails
- index.vue
- settled
- index.vue
- shopStreet
- index.vue
- user
- index.vue
- users
- browsingHistory
- index.vue
- commission_rank
- index.vue
- distributor
- index.vue
- feedback
- detail.vue
- index.vue
- list.vue
- goods_comment_con
- index.vue
- goods_comment_list
- index.vue
- goods_details_store
- index.vue
- goods_logistics
- index.vue
- goods_return
- index.vue
- login
- index.vue
- order_confirm
- index.vue
- order_list
- index.vue
- presell_order_list
- index.vue
- promoter-list
- index.vue
- promoter-order
- index.vue
- promoter_rank
- index.vue
- components
- adc
- index.vue
- addInvoicing
- index.vue
- addressWindow
- index.vue
- alert
- index.vue
- checkCoupon
- index.vue
- checkDelivery
- index.vue
- combinNav
- index.vue
- countDown
- index.vue
- couponListWindow
- index.vue
- couponWindow
- index.vue
- easy-upload
- easy-upload.vue
- readme.md
- goodList
- index.vue
- home
- index.vue
- invoiceGoods
- index.vue
- jyf-parser
- libs
- config.js
- CssHandler.js
- handler.sjs
- handler.wxs
- MpHtmlParser.js
- trees.vue
- jyf-parser.vue
- Loading
- index.vue
- mpvue-calendar
- browser-style.css
- calendarinit.js
- icon.css
- mpvue-calendar.vue
- style.css
- orderGoods
- index.vue
- payment
- index.vue
- PriceChange
- index.vue
- productConSwiper
- index.vue
- productWindow
- index.vue
- promotionGood
- index.vue
- recommend
- index.vue
- shareInfo
- index.vue
- shareRedPackets
- index.vue
- swipers
- index.vue
- ucharts
- component.vue
- uni-calendar
- calendar.js
- uni-calendar-item.vue
- uni-calendar.vue
- util.js
- userEvaluation
- index.vue
- userNameSwiper
- userNameSwiper.vue
- zb-code
- qrcode.js
- zb-code.vue
- Authorize.vue
- emptyPage.vue
- rightSlider.vue
- tabNav.vue
- config
- app.js
- cache.js
- socket.js
- libs
- chat.js
- login.js
- order.js
- routine.js
- spread.js
- wechat.js
- mixins
- history.js
- SendVerifyCode.js
- 源码下载