1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <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>
- </mobile-frame>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {};
- },
- onShow: function() {
- const that = this;
- // 监听用户是否登录
- that.watchLogin();
- },
- methods: {
- // 公共跳转
- toCommon(e) {
- uni.navigateTo({
- url: `/${e}`
- });
- },
- watchLogin() {
- uni.redirectTo({
- url: `/pages/home/index`
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .main {
- .one {
- text-align: center;
- button {
- margin: 2vw;
- }
- }
- }
- </style>
|