diff --git a/yudao-ui-admin/.env.dev b/yudao-ui-admin/.env.dev index cd578096a..dc7c069b3 100644 --- a/yudao-ui-admin/.env.dev +++ b/yudao-ui-admin/.env.dev @@ -5,8 +5,8 @@ ENV = 'development' VUE_APP_TITLE = 创盈商户管理系统 # 芋道管理系统/开发环境 -VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' -#VUE_APP_BASE_API = 'http://192.168.1.147:48080' +#VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' +VUE_APP_BASE_API = 'http://192.168.1.147:48080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/yudao-ui-admin/src/views/system/tenant/index.vue b/yudao-ui-admin/src/views/system/tenant/index.vue index 232af1852..c7f5efcc3 100755 --- a/yudao-ui-admin/src/views/system/tenant/index.vue +++ b/yudao-ui-admin/src/views/system/tenant/index.vue @@ -83,7 +83,7 @@ trigger="click" popper-class="qrcode-wrap" > - + 推广码 @@ -345,9 +345,11 @@ export default { this.resetForm('form'); }, handleQRCode(row) { - const url =`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7e503d9cded34c07&redirect_uri= - http://192.168.1.149:8080?tenantId=${row.id}&response_type=code&scope=snsapi_base&state=123#wechat_redirect` - QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, function (error) { + const baseUrl = 'http://yuxy.perrymake.com' + const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${row.id}` + QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, { + scale: 2 + }, function (error) { if (error) console.error(error) console.log('success!'); }) diff --git a/yudao-ui-app/App.vue b/yudao-ui-app/App.vue index d1cd86338..e354edfd0 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' import { memberGradeInfo @@ -30,10 +32,10 @@ }, onLaunch: function(option) { const res = memberGradeInfo().then((res) =>{ - if(res.data.some((item) => !!!parseInt(item.isExist))){ + if(res.data.some((item) => !!parseInt(item.isExist))){ uni.setTabBarItem({ index: 2, - text: 'text', + text: 'text', pagePath: '/pages/member_equity/index' }) } @@ -171,16 +173,21 @@ } // #endif }, + computed: mapGetters(['tenantId']), async mounted() { + this.isQRCode() 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() } + this.setSpreadId() setInterval(() => { if (this.$store.getters.isLogin) { this.setRefreshToken() @@ -188,11 +195,28 @@ }, 60000) }, methods: { + // 是否扫码跳转 + isQRCode() { + const redirectUrl = this.$route.query.redirectUrl || '' + if (redirectUrl) { + const tenantId = this.$route.query.tenantId || '' + const spreadId = this.$route.query.spreadId || '' + const wechatUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7e503d9cded34c07' + location.href =`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect` + } + }, + // 获取租户信息 + getTenantInfo() { + fetchTenantInfo(this.tenantId).then(res => { + this.$store.commit("SET_TENANT_INFO", res.data); + }) + }, // 获取租户ID getTenantId() { - const tenantId = this.$route.query.tenantId + const tenantId = this.$route.query.tenantId || '' if (tenantId) { this.$store.commit("SET_TENANTID", tenantId); + this.getTenantInfo() } else { this.$util.Tips({ title: '请扫码物业公司二维码访问' @@ -201,8 +225,8 @@ }, // 获取推广员ID setSpreadId() { - const spreadId = this.$route.query.spreadId - if (tenantId) { + const spreadId = this.$route.query.spreadId || '' + if (spreadId) { this.$store.commit("SET_SPREADID", spreadId); } }, @@ -210,8 +234,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/api/member.js b/yudao-ui-app/api/member.js index 8e1f99336..fc6b2af04 100644 --- a/yudao-ui-app/api/member.js +++ b/yudao-ui-app/api/member.js @@ -5,19 +5,26 @@ import request from "@/utils/request.js"; * 查询会员档次信息 */ export function memberGradeInfo(){ - return request.get('api/order/member/memberGradeInfo', {},{noAuth:true}) + return request.get('api/order/member/memberGradeInfo', {}) } /** * 获取当前登录账号的充值记录 */ export function memberOrderInfo(){ - return request.get('api/order/member/memberOrderInfo', {},{noAuth:true}) + return request.get('api/order/member/memberOrderInfo', {}) } /** * 会员充值 */ export function memberTopUp(data) { - return request.post('api/order/member/memberTopUp',data,{ noAuth: true }); + return request.post('api/order/member/memberTopUp',data); } + +/** + * 申请退款 + */ +export function memberApplyRefund(data) { + return request.post('api/order/member/memberApplyRefund',data); +} \ No newline at end of file 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 dee55e5e6..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_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/member_application/index.vue b/yudao-ui-app/pages/member_application/index.vue index e8bfeb925..391a76f64 100644 --- a/yudao-ui-app/pages/member_application/index.vue +++ b/yudao-ui-app/pages/member_application/index.vue @@ -38,6 +38,12 @@ + + + + + + @@ -54,6 +60,18 @@ }, data() { return { + title:'管理', + list: [ + { + name:'购买记录', + fontSize:'28' + }, + { + name:'为他人充值', + fontSize:'28' + }, + ], + show: false, memberData: [], payInfo: { userPhone: '', @@ -82,18 +100,27 @@ }; }, async onLoad() { - // uni.setTabBarItem({ - // index: 2, - // text: 'text', - // pagePath: '/pages/member_equity/index' - // }) - // uni.switchTab({ - // url:'/pages/member_equity/index' - // }) const res = await memberGradeInfo() this.memberData = res.data }, methods: { + handleSelect(value){ + switch (value.name){ + case "购买记录": + uni.navigateTo({ + url:'/pages/member_record/index' + }) + break; + case "为他人充值": + console.log(123) + uni.navigateTo({ + url:'/pages/member_others/index' + }) + break; + default: + break; + } + }, handleMember(value, index) { if (!!parseInt(value.isExist)) return if (this.activeIndex.includes(index)) { @@ -119,6 +146,10 @@ userPhone: store.state.app.userInfo.mobile, orderInfos } + }else{ + this.$util.Tips({ + title: '请选择档次套餐' + }) } }, /** @@ -168,6 +199,7 @@ 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 @@
-
- - +
+ + +
+
+ +
- +
- +