diff --git a/api/system/user.js b/api/system/user.js index f34c46f..a177c2e 100644 --- a/api/system/user.js +++ b/api/system/user.js @@ -67,7 +67,7 @@ const user = { return new Promise((resolve, reject) => { getInfo().then(res => { const user = res.user - let avatar = user.avatar || "" + let avatar = (isEmpty(user) || isEmpty(user.avatar)) ? "" : user.avatar if (!isHttp(avatar)) { avatar = (isEmpty(avatar)) ? defAva : baseUrl + avatar } diff --git a/config.js b/config.js index ce0e7e7..1617c5a 100644 --- a/config.js +++ b/config.js @@ -2,7 +2,8 @@ module.exports = { // baseUrl: 'https://vue.ruoyi.vip/prod-api', - baseUrl:'http://yunzs.haich.cc', + // baseUrl:'http://yunzs2.haich.cc', + baseUrl:'https://yunzs.haich.cc', // baseUrl:'http://193.112.94.36:8080', // baseUrl = 'https://api.ruoyi.com' // prodApi: 'https://vue.ruoyi.vip/prod-api', @@ -15,6 +16,7 @@ module.exports = { version: "1.2.0", // 应用logo logo: "http://193.112.94.36:8099/static/images/logo.png", + // logo: "http://yunzs.haich.cc/static/images/logo.png", // 官方网站 site_url: "http://ruoyi.vip", // 政策协议 diff --git a/pages.json b/pages.json index b904ee6..ab4224c 100644 --- a/pages.json +++ b/pages.json @@ -174,6 +174,12 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "pages/navailable/navailable", + "style": { + "navigationBarTitleText": "" + } } ], "tabBar": { diff --git a/pages/addBrand/addBrand.vue b/pages/addBrand/addBrand.vue index 3fd9330..0bccdf8 100644 --- a/pages/addBrand/addBrand.vue +++ b/pages/addBrand/addBrand.vue @@ -3,7 +3,7 @@ - + 品牌管理 diff --git a/pages/edit/edit.vue b/pages/edit/edit.vue index d5054ab..aaf877f 100644 --- a/pages/edit/edit.vue +++ b/pages/edit/edit.vue @@ -3,7 +3,7 @@ - + 编辑商品 diff --git a/pages/expired/expired.vue b/pages/expired/expired.vue index 1a51823..f229283 100644 --- a/pages/expired/expired.vue +++ b/pages/expired/expired.vue @@ -126,19 +126,32 @@ + - - - 编辑商品 + + + 盘点库存 - - - 调整库存 + + + 出库 - - - 删除商品 + + + 批量删除商品 + + + + 分类管理 + + + + 品牌管理 + + + + 条码规则设置 取消 @@ -233,18 +246,23 @@ } }, - switchTab(tab) { - if (tab === 'all' || tab === 'outstock') { - // 跳转到商品列表页面,并传递当前标签 - uni.navigateTo({ - url: `/pages/product/product?tab=${tab}` - }); - } else { - this.currentTab = tab; - // 这里可以添加筛选逻辑 - console.log('切换到标签:', tab); - } - }, + switchTab(tab) { + if (tab === 'all') { + // 跳转到商品列表页面,并传递当前标签 + uni.navigateTo({ + url: `/pages/product/product?tab=${tab}` + }); + } else if (tab === 'outstock') { + // 跳转到缺货页面 + uni.navigateTo({ + url: `/pages/navailable/navailable?tab=${tab}` + }); + } else { + this.currentTab = tab; + // 这里可以添加筛选逻辑 + console.log('切换到标签:', tab); + } + }, onSearch() { console.log('搜索关键词:', this.searchText); diff --git a/pages/index.vue b/pages/index.vue index 50da609..227e333 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -2,10 +2,62 @@ - + - + + + + + + + + + + 名称 + > + + + + + + 个人店 + + + + + 微店智能店 + ID:1234567890 | 管理员 + + + + + + + + 企业管理 + + + + + 企业名称 + 总部/管理员 + + + + + + 创建企业组织 + + + + + + + 创建店铺 + + + @@ -21,7 +73,7 @@ - {{ storeName }} + {{ storeName }} 值守中 @@ -56,19 +108,19 @@ - 202 + 0 今日进店 - 121 + 0 支付订单 - 433.23 + 0 支付金额 - + 分享 @@ -244,7 +296,8 @@ export default { return { // 可以在这里添加数据 showLeft: false, - storeName: '我的便利店' // 门店名称 + storeName: '我的便利店', // 门店名称 + selectedShop: 'personal' // 新增:默认选中个人店 } }, onShow() { @@ -255,6 +308,10 @@ export default { } }, methods: { + // 新增:切换选中店铺的方法 + selectShop(type) { + this.selectedShop = type; + }, navigateTo(page) { uni.showToast({ title: `跳转到${page}`, @@ -270,6 +327,11 @@ export default { url: '/pages/user/user' }) }, + goSetting(){ + uni.navigateTo({ + url: '/pages/settings/settings' + }) + }, goToProduct() { uni.navigateTo({ url: '/pages/product/product' @@ -338,6 +400,100 @@ export default { \ No newline at end of file diff --git a/pages/settings/settings.vue b/pages/settings/settings.vue index 89b13cf..b24256f 100644 --- a/pages/settings/settings.vue +++ b/pages/settings/settings.vue @@ -71,6 +71,11 @@ + + + 退出登录 + + @@ -100,7 +105,14 @@ export default { // break; // // ... 其他页面跳转 // } - } + }, + handleLogout() { + this.$modal.confirm('确定注销并退出系统吗?').then(() => { + this.$store.dispatch('LogOut').then(() => {}).finally(()=>{ + this.$tab.reLaunch('/pages/index') + }) + }) + } } } @@ -122,7 +134,26 @@ export default { color: #333333; } } + .logout-text { + font-size: 34rpx; + color: red; + } + .logout-btn { + width: 100%; + height: 88rpx; + background-color: #ffffff; + border-radius: 12rpx; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + } + /* ========== 退出登录模块 ========== */ + .logout-module { + margin-top: 40rpx; + padding: 0 40rpx; + } .settings-section { margin-top: 30rpx; background-color: #ffffff; diff --git a/pages/user/user.vue b/pages/user/user.vue index f010b3c..d4e1320 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -64,7 +64,7 @@ - + 退出登录 @@ -138,6 +138,13 @@ } } }) + }, + handleLogout() { + this.$modal.confirm('确定注销并退出系统吗?').then(() => { + this.$store.dispatch('LogOut').then(() => {}).finally(()=>{ + this.$tab.reLaunch('/pages/index') + }) + }) } } } diff --git a/store/modules/user.js b/store/modules/user.js index 6af1e7c..2f78fb1 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -68,12 +68,12 @@ const user = { return new Promise((resolve, reject) => { getInfo().then(res => { const user = res.user - let avatar = user.avatar || "" - if (!isHttp(avatar)) { + let avatar = (isEmpty(user) || isEmpty(user.avatar)) ? "" : user.avatar + if (!isHttp(avatar)) { avatar = (isEmpty(avatar)) ? defAva : baseUrl + avatar } const userid = (isEmpty(user) || isEmpty(user.userId)) ? "" : user.userId - const username = (isEmpty(user) || isEmpty(user.userName)) ? "" : user.userName + const username = (isEmpty(user) || isEmpty(user.userName)) ? "" : user.userName if (res.roles && res.roles.length > 0) { commit('SET_ROLES', res.roles) commit('SET_PERMISSIONS', res.permissions)