12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <mobile-frame>
- <view class="main">
- <view class="one">
- <button size="mini" @click="toCommon('pages/login/index')">登录页面</button>
- <button size="mini" @click="toCommon('pages/home/index')">首页</button>
- <button size="mini" @click="toCommon('pages/store/index')">微店</button>
- <button size="mini" @click="toCommon('pages/week/index')">周边</button>
- <button size="mini" @click="toCommon('pages/market/index')">购物车</button>
- <button size="mini" @click="toCommon('pages/my/index')">我的1</button>
- </view>
- <view class="two">
- </view>
- </view>
- </mobile-frame>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- };
- },
- onLoad: function() {},
- onShow: function() {
- const that = this;
- // 监听用户是否登录
- that.watchLogin();
- },
- methods: {
- // 公共跳转
- toCommon(e) {
- uni.navigateTo({
- url: `/${e}`
- });
- },
- watchLogin() {
- uni.getSystemInfo({
- success: async function(res) {
- uni.setStorage({
- key: 'system',
- data: res,
- success: function() {
- uni.redirectTo({
- url: `/pages/home/index`
- })
- }
- });
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- .main {
- .one {
- text-align: center;
- button {
- margin: 2vw;
- }
- }
- }
- </style>
|