From 381632dc9dc776d0cb335b3b430538ef8d9f133a Mon Sep 17 00:00:00 2001 From: TianYu <332368756@qq.com> Date: Fri, 19 May 2023 11:25:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UI=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-app/App.vue | 20 +- yudao-ui-app/api/api.js | 214 +-- .../components/paymentMember/index.vue | 8 +- yudao-ui-app/config/cache.js | 2 + yudao-ui-app/pages.json | 27 +- yudao-ui-app/pages/user/index.vue | 1180 +++++++++-------- yudao-ui-app/pages/users/login/index.vue | 18 +- yudao-ui-app/pages/users/register/index.vue | 121 +- yudao-ui-app/pages/users/register/success.vue | 56 + .../pages/users/retrievePassword/index.vue | 375 ++++-- yudao-ui-app/static/images/bg-linear.png | Bin 0 -> 278710 bytes yudao-ui-app/static/images/code_3.png | Bin 0 -> 3108 bytes yudao-ui-app/static/images/code_4.png | Bin 0 -> 4347 bytes yudao-ui-app/static/images/phone_2.png | Bin 0 -> 2722 bytes .../static/images/tabbar/nav_icon_cart.png | Bin 0 -> 5149 bytes .../images/tabbar/nav_icon_member_active.png | Bin 0 -> 11549 bytes .../static/images/tabbar/nav_icon_my.png | Bin 0 -> 5048 bytes .../static/images/tabbar/nav_icon_shop.png | Bin 0 -> 4970 bytes .../static/images/tabbar/nav_icon_sort.png | Bin 0 -> 5284 bytes yudao-ui-app/static/images/user_1.png | Bin 0 -> 5656 bytes yudao-ui-app/store/getters.js | 1 + yudao-ui-app/store/modules/app.js | 8 +- 22 files changed, 1165 insertions(+), 865 deletions(-) create mode 100644 yudao-ui-app/pages/users/register/success.vue create mode 100644 yudao-ui-app/static/images/bg-linear.png create mode 100644 yudao-ui-app/static/images/code_3.png create mode 100644 yudao-ui-app/static/images/code_4.png create mode 100644 yudao-ui-app/static/images/phone_2.png create mode 100644 yudao-ui-app/static/images/tabbar/nav_icon_cart.png create mode 100644 yudao-ui-app/static/images/tabbar/nav_icon_member_active.png create mode 100644 yudao-ui-app/static/images/tabbar/nav_icon_my.png create mode 100644 yudao-ui-app/static/images/tabbar/nav_icon_shop.png create mode 100644 yudao-ui-app/static/images/tabbar/nav_icon_sort.png create mode 100644 yudao-ui-app/static/images/user_1.png diff --git a/yudao-ui-app/App.vue b/yudao-ui-app/App.vue index 755454fb3..339d19798 100644 --- a/yudao-ui-app/App.vue +++ b/yudao-ui-app/App.vue @@ -4,7 +4,8 @@ } from "./libs/login"; import { refreshToken, - getWeChatOpenId + getWeChatOpenId, + fetchTenantInfo } from "@/api/api"; import { HTTP_REQUEST_URL @@ -13,7 +14,8 @@ import Routine from './libs/routine.js'; import Apps from './libs/apps.js'; import { - mapActions + mapActions, + mapGetters } from 'vuex' export default { @@ -159,12 +161,15 @@ } // #endif }, + computed: mapGetters(['tenantId']), async mounted() { if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) { await this.$store.dispatch('USERINFO'); } if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) { this.getTenantId() + } else { + this.getTenantInfo() } if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) { this.getWxChatCode() @@ -176,11 +181,18 @@ }, 60000) }, methods: { + // 获取租户信息 + getTenantInfo() { + fetchTenantInfo(this.tenantId).then(res => { + this.$store.commit("SET_TENANT_INFO", res.data); + }) + }, // 获取租户ID getTenantId() { const tenantId = this.$route.query.tenantId if (tenantId) { this.$store.commit("SET_TENANTID", tenantId); + this.getTenantInfo() } else { this.$util.Tips({ title: '请扫码物业公司二维码访问' @@ -198,8 +210,8 @@ getWxChatCode() { const code = this.$route.query.code getWeChatOpenId(code).then(res => { - if(res.data){ - this.$store.commit("SET_OPENID", res.data); + if (res.data) { + this.$store.commit("SET_OPENID", res.data); } }) }, diff --git a/yudao-ui-app/api/api.js b/yudao-ui-app/api/api.js index 98c9c961d..017325e3e 100644 --- a/yudao-ui-app/api/api.js +++ b/yudao-ui-app/api/api.js @@ -2,35 +2,44 @@ import request from "@/utils/request.js"; /** * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册 * -*/ + */ /** * 获取主页数据 无需授权 * -*/ -export function getIndexData() -{ - return request.get("index",{},{ noAuth : true}); + */ +export function getIndexData() { + return request.get("index", {}, { + noAuth: true + }); } /** * 获取登录授权login * -*/ -export function getLogo() -{ - return request.get('wechat/getLogo', {}, { noAuth : true}); + */ +export function getLogo() { + return request.get('wechat/getLogo', {}, { + noAuth: true + }); } -export function refreshToken(token) -{ - return request.post('member/auth/refresh-token?refreshToken=' + token, {}, { noAuth : true}); +export function refreshToken(token) { + return request.post('member/auth/refresh-token?refreshToken=' + token, {}, { + noAuth: true + }); } // 获取微信OpenId -export function getWeChatOpenId(code) -{ - return request.get('api/order/member/getOpenId?code=' + code, {}, { noAuth : true}); +export function getWeChatOpenId(code) { + return request.get('api/order/member/getOpenId?code=' + code, {}, { + noAuth: true + }); +} + +// 获取租户信息 +export function fetchTenantInfo(id) { + return request.get('tenant/get?id=' + id, {}); } /** @@ -38,133 +47,165 @@ export function getWeChatOpenId(code) * @param string formId */ export function setFormId(formId) { - return request.post("wechat/set_form_id", { formId: formId}); + return request.post("wechat/set_form_id", { + formId: formId + }); } /** * 领取优惠卷 * @param int couponId * -*/ -export function setCouponReceive(couponId){ - return request.post('coupon/receive', { couponId: couponId}); + */ +export function setCouponReceive(couponId) { + return request.post('coupon/receive', { + couponId: couponId + }); } /** * 优惠券列表 * @param object data -*/ -export function getCoupons(data){ - return request.get('coupons',data,{noAuth:true}) + */ +export function getCoupons(data) { + return request.get('coupons', data, { + noAuth: true + }) } /** * 我的优惠券 * @param int types 0全部 1未使用 2已使用 -*/ -export function getUserCoupons(data){ - return request.get('coupon/list',data) + */ +export function getUserCoupons(data) { + return request.get('coupon/list', data) } /** * 文章分类列表 * -*/ -export function getArticleCategoryList(){ - return request.get('article/category/list',{},{noAuth:true}) + */ +export function getArticleCategoryList() { + return request.get('article/category/list', {}, { + noAuth: true + }) } /** * 文章列表 * @param int cid * -*/ -export function getArticleList(cid,data){ - return request.get('article/list/' + cid, data,{noAuth:true}) + */ +export function getArticleList(cid, data) { + return request.get('article/list/' + cid, data, { + noAuth: true + }) } /** * 文章 热门列表 * -*/ -export function getArticleHotList(){ - return request.get('article/hot/list',{},{noAuth:true}); + */ +export function getArticleHotList() { + return request.get('article/hot/list', {}, { + noAuth: true + }); } /** * 文章 轮播列表 * -*/ -export function getArticleBannerList(){ - return request.get('article/banner/list',{},{noAuth:true}) + */ +export function getArticleBannerList() { + return request.get('article/banner/list', {}, { + noAuth: true + }) } /** * 文章详情 * @param int id * -*/ -export function getArticleDetails(id){ - return request.get('article/info',id,{noAuth:true}); + */ +export function getArticleDetails(id) { + return request.get('article/info', id, { + noAuth: true + }); } /** * 手机号+验证码登录接口 * @param object data -*/ -export function loginMobile(data){ - return request.post('login/mobile',data,{noAuth:true}) + */ +export function loginMobile(data) { + return request.post('login/mobile', data, { + noAuth: true + }) } /** * 获取短信KEY * @param object phone -*/ -export function verifyCode(){ - return request.get('verify_code', {},{noAuth:true}) + */ +export function verifyCode() { + return request.get('verify_code', {}, { + noAuth: true + }) } /** * 验证码发送 * @param object phone -*/ -export function registerVerify(phone){ - return request.post('sendCode', { phone: phone },{noAuth:true},1) + */ +export function registerVerify(phone) { + return request.post('sendCode', { + phone: phone + }, { + noAuth: true + }, 1) } /** * 手机号注册 * @param object data * -*/ -export function phoneRegister(data){ - return request.post('register',data,{noAuth:true}); + */ +export function phoneRegister(data) { + return request.post('register', data, { + noAuth: true + }); } /** * 手机号修改密码 * @param object data * -*/ -export function phoneRegisterReset(data){ - return request.post('register/reset',data,{noAuth:true}) + */ +export function phoneRegisterReset(data) { + return request.post('register/reset', data, { + noAuth: true + }) } /** * 手机号+密码登录 * @param object data * -*/ -export function phoneLogin(data){ - return request.post('login',data,{noAuth:true}) + */ +export function phoneLogin(data) { + return request.post('login', data, { + noAuth: true + }) } /** * 切换H5登录 * @param object data -*/ + */ // #ifdef MP -export function switchH5Login(){ - return request.post('switch_h5', { 'from':'routine'}); +export function switchH5Login() { + return request.post('switch_h5', { + 'from': 'routine' + }); } // #endif @@ -173,67 +214,80 @@ export function switchH5Login(){ * */ // #ifdef H5 export function switchH5Login() { - return request.post("switch_h5", { 'from': "wechat" }); + return request.post("switch_h5", { + 'from': "wechat" + }); } // #endif /** * 换绑手机号 * -*/ -export function bindingPhone(data){ - return request.post('update/binding',data); + */ +export function bindingPhone(data) { + return request.post('update/binding', data); } /** * 换绑手机号校验 * -*/ -export function bindingVerify(data){ - return request.post('update/binding/verify',data); + */ +export function bindingVerify(data) { + return request.post('update/binding/verify', data); } /** * 退出登錄 * -*/ -export function logout(){ + */ +export function logout() { return request.get('logout'); } /** * 获取订阅消息id */ -export function getTemlIds(data) -{ - return request.get('wechat/program/my/temp/list', data , { noAuth:true}); +export function getTemlIds(data) { + return request.get('wechat/program/my/temp/list', data, { + noAuth: true + }); } /** * 首页拼团数据 */ -export function pink() -{ - return request.get('pink', {}, { noAuth:true}); +export function pink() { + return request.get('pink', {}, { + noAuth: true + }); } /** * 获取城市信息 */ export function getCity() { - return request.get('area/tree', { }, { noAuth: true }); + return request.get('area/tree', {}, { + noAuth: true + }); } /** * 获取小程序直播列表 */ -export function getLiveList(page,limit) { - return request.get('wechat/live', { page, limit}, { noAuth: true }); +export function getLiveList(page, limit) { + return request.get('wechat/live', { + page, + limit + }, { + noAuth: true + }); } /** * 获取小程序二维码 */ export function getQrcode(data) { - return request.post('qrcode/get',data,{ noAuth: true }); + return request.post('qrcode/get', data, { + noAuth: true + }); } diff --git a/yudao-ui-app/components/paymentMember/index.vue b/yudao-ui-app/components/paymentMember/index.vue index 692d924e5..522ad8988 100644 --- a/yudao-ui-app/components/paymentMember/index.vue +++ b/yudao-ui-app/components/paymentMember/index.vue @@ -88,8 +88,9 @@ }, function(res) { if (res.err_msg == "get_brand_wcpay_request:ok") { - // 使用以上方式判断前端返回,微信团队郑重提示: - //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 + uni.switchTab({ + url: '/pages/member_application/index' + }) } }) } @@ -110,7 +111,8 @@ title: '请选择要支付的订单' }); uni.showLoading({ - title: '支付中' + title: '支付中', + mask: true }); if(paytype === 'WXPAY' && !that.openId) { return that.$util.Tips({ diff --git a/yudao-ui-app/config/cache.js b/yudao-ui-app/config/cache.js index 1cf32e17d..5292828cb 100644 --- a/yudao-ui-app/config/cache.js +++ b/yudao-ui-app/config/cache.js @@ -10,6 +10,8 @@ module.exports = { OPEN_ID: 'OPEN_ID', //用户信息 USER_INFO: 'USER_INFO', + //租户信息 + TENANT_INFO: 'TENANT_INFO', //token 过期时间 EXPIRES_TIME: 'EXPIRES_TIME', //微信授权 diff --git a/yudao-ui-app/pages.json b/yudao-ui-app/pages.json index 25c9a715e..d4057b600 100644 --- a/yudao-ui-app/pages.json +++ b/yudao-ui-app/pages.json @@ -443,6 +443,13 @@ "navigationBarTitleText": "注册", "navigationStyle": "custom" } + }, + { + "path": "register/success", + "style": { + "navigationBarTitleText": "注册成功", + "navigationStyle": "custom" + } } ] }, @@ -562,37 +569,31 @@ "backgroundColor": "#ffffff", "list": [{ "pagePath": "pages/index/index", - "iconPath": "static/images/1-001.png", + "iconPath": "static/images/tabbar/nav_icon_shop.png", "selectedIconPath": "static/images/1-002.png", - "text": "首页" + "text": "商城" }, { "pagePath": "pages/goods_cate/goods_cate", - "iconPath": "static/images/2-001.png", + "iconPath": "static/images/tabbar/nav_icon_sort.png", "selectedIconPath": "static/images/2-002.png", "text": "分类" }, { - "pagePath": "pages/member_record/index", + "pagePath": "pages/member_application/index", "iconPath": "static/images/2-001.png", - "selectedIconPath": "static/images/2-002.png", + "selectedIconPath": "static/images/tabbar/nav_icon_member_active.png", "text": "会员申请" }, - // { - // "pagePath": "pages/member_application/index", - // "iconPath": "static/images/2-001.png", - // "selectedIconPath": "static/images/2-002.png", - // "text": "会员申请" - // }, { "pagePath": "pages/order_addcart/order_addcart", - "iconPath": "static/images/3-001.png", + "iconPath": "static/images/tabbar/nav_icon_cart.png", "selectedIconPath": "static/images/3-002.png", "text": "购物车" }, { "pagePath": "pages/user/index", - "iconPath": "static/images/4-001.png", + "iconPath": "static/images/tabbar/nav_icon_my.png", "selectedIconPath": "static/images/4-002.png", "text": "我的" } diff --git a/yudao-ui-app/pages/user/index.vue b/yudao-ui-app/pages/user/index.vue index 58437e377..ebe3b9126 100644 --- a/yudao-ui-app/pages/user/index.vue +++ b/yudao-ui-app/pages/user/index.vue @@ -1,46 +1,45 @@ diff --git a/yudao-ui-app/pages/users/login/index.vue b/yudao-ui-app/pages/users/login/index.vue index 0a60e290b..de1ca580a 100644 --- a/yudao-ui-app/pages/users/login/index.vue +++ b/yudao-ui-app/pages/users/login/index.vue @@ -8,20 +8,24 @@
-
- - +
+ + +
+
+ +
- +
- +