diff --git a/apis/index.js b/apis/index.js
index d8664da..3bb3546 100644
--- a/apis/index.js
+++ b/apis/index.js
@@ -9,11 +9,11 @@ import store from '@/store'
// 基础配置
const config = {
- // apiUrl : 'https://oapi.lianshang.vip/api/',
- // apiUrls : 'https://oapi.lianshang.vip/',
+ apiUrl : 'https://oapi.lianshang.vip/api/',
+ apiUrls : 'https://oapi.lianshang.vip/',
- apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
- apiUrls : 'http://api.ahxh.shangkelian.cn/',
+ // apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
+ // apiUrls : 'http://api.ahxh.shangkelian.cn/',
timeout : 60000
}
@@ -34,9 +34,6 @@ const request = (parameter) => {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
-
- // console.log('parameterDbug', parameter)
-
// 加载提示
uni.showLoading({
title: '加载中',
diff --git a/apis/interfaces/vip.js b/apis/interfaces/vip.js
index 0784a70..cae8a79 100644
--- a/apis/interfaces/vip.js
+++ b/apis/interfaces/vip.js
@@ -25,9 +25,10 @@ const vipOrder = (id, data) =>{
}
// 开通会员微信支付
-const vipWechatPay = id => {
+const vipWechatPay = (id, data) => {
return request({
- url : 'user/identities/pay/' + id + '/wechat'
+ url: 'user/identities/pay/' + id + '/wechat',
+ data
})
}
diff --git a/apis/interfaces/wx.js b/apis/interfaces/wx.js
index 2fede15..be5c261 100644
--- a/apis/interfaces/wx.js
+++ b/apis/interfaces/wx.js
@@ -9,13 +9,32 @@
import { request } from '../index'
+// 微信配置信息
const wxConfig = data => {
return request({
- url : 'user/auth/get_jssdk',
- data : data
+ url: 'user/auth/get_jssdk',
+ data
+ })
+}
+
+// 鉴权转跳地址
+const wxCode = data => {
+ return request({
+ url: 'user/auth/get_auth_url',
+ data
+ })
+}
+
+// 获取openid
+const wxOpenid = data => {
+ return request({
+ url: 'user/auth/get_openid',
+ data
})
}
export {
- wxConfig
+ wxConfig,
+ wxCode,
+ wxOpenid
}
diff --git a/pages.json b/pages.json
index b013e69..0fad0e7 100644
--- a/pages.json
+++ b/pages.json
@@ -332,8 +332,12 @@
},
"name": "withdrawList",
"aliasPath": "/wallet/withdraw/list"
- }
- ],
+ }, {
+ "path" : "pages/wxAuth/wxAuth",
+ "name" : "wxAuth",
+ "aliasPath": "/wechat-auth"
+ }
+ ],
"globalStyle": {
"navigationStyle": "custom",
"backgroundColor": "#F5F5F5"
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 950f5f8..75807a3 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -57,9 +57,6 @@
}
},
onShow(){
-
- console.log(this.$Route)
-
this.parentId = this.$Route.query.invite || ''
},
methods: {
diff --git a/pages/vip/vip.vue b/pages/vip/vip.vue
index 2ed047f..34838d1 100644
--- a/pages/vip/vip.vue
+++ b/pages/vip/vip.vue
@@ -1,105 +1,90 @@
-
-
-
-
- 上传打款凭证
-
- 提交
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
- {{item.count.stock > 0 ? '剩余名额:' + item.count.residue : '不限名数'}}
-
-
-
-
- {{item.title}}
-
-
-
-
- {{item.title}}
-
-
-
-
- {{item.title}}
-
-
-
-
- {{item.title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- 节点定义
-
- {{identitie[tabsIndex].node_definition}}
-
-
-
-
-
-
- 升级条件
-
-
- {{openCondition.energy_shard.message}}
- {{openCondition.price.message}}
- {{openCondition.service_charge.message}}
-
-
- {{openCondition.price.message}}
-
-
-
-
-
-
-
- 节点权益
-
-
- &{{item.remark}}
-
-
-
-
-
-
-
- 请仔细阅读并确认服务协议
-
-
-
- 会员服务协议
-
-
-
-
-
+}
+// 会员特权
+.privilege {
+ padding: 20rpx 30rpx 80rpx;
+ box-sizing: border-box;
+ .privilege-list {
+ margin-bottom: 50rpx;
+ display: flex;
+ .privilege-img {
+ width: 74rpx;
+ height: 74rpx;
+ }
+ .privilege-text {
+ width: calc(100% - 74rpx);
+ padding-left: 40rpx;
+ font-size: 32rpx;
+ color: #999999;
+ line-height: 52rpx;
+ .privilege-name {
+ font-size: 40rpx;
+ color: #000000;
+ margin: 10rpx 0 20rpx;
+ }
+ .privilege-label.active {
+ color: #f6b338;
+ }
+ .privilege-right {
+ color: #7877eb;
+ }
+ }
+ }
+}
+
+// 用户协议
+.agree {
+ margin: $margin 0;
+ text-align: center;
+ .agree-tips {
+ background-color: #999999;
+ display: inline-block;
+ padding: 14rpx $padding;
+ color: #ffffff;
+ border-radius: 60rpx;
+ }
+}
+.agree-btn {
+ display: flex;
+ font-size: $title-size-lg;
+ text-align: left;
+ color: #999999;
+ padding: $padding;
+}
+
+// .content{
+// min-height: 100vh;
+// background: #fefaef;
+// }
+// 开通须知
+.notice {
+ font-size: $title-size-m;
+ color: $text-gray;
+ padding: $padding $padding * 2 $padding * 2;
+ .title {
+ padding-bottom: $padding/2;
+ font-weight: bold;
+ }
+ .item {
+ padding-bottom: $padding/2;
+ line-height: 40rpx;
+ text-align: justify;
+ }
+}
+// footer
+.footer {
+ padding: 0 $padding;
+ box-sizing: border-box;
+ text-align: center;
+ .footer-btn {
+ width: 74%;
+ }
+}
+// 会员权限
+.privilege {
+ padding: $padding;
+ .title {
+ font-weight: bold;
+ color: #322711;
+ font-size: $title-size;
+ text-align: center;
+ line-height: 90rpx;
+ }
+ .privilege-box {
+ display: flex;
+ flex-wrap: wrap;
+ padding: $padding 0;
+ .item {
+ width: 25%;
+ padding: $padding/2;
+ box-sizing: border-box;
+ text-align: center;
+ .icon {
+ width: 78rpx;
+ height: 78rpx;
+ background: #bd995d;
+ border-radius: 50%;
+ vertical-align: top;
+ }
+ .text {
+ font-size: $title-size-sm;
+ color: #201212;
+ line-height: 60rpx;
+ }
+ }
+ }
+}
+// 会员卡
+.cards {
+ position: relative;
+ background: #1f1b1c;
+ .card {
+ position: relative;
+ margin: 0 $margin;
+ background: linear-gradient(to right, #3b3d4a, #231d1f);
+ padding: 15rpx;
+ border-radius: $radius/2;
+ z-index: 2;
+ .card-content {
+ position: relative;
+ border: solid 1rpx rgba($color: white, $alpha: 0.4);
+ border-radius: $radius/2;
+ padding: 30rpx 180rpx 60rpx 148rpx;
+ min-height: 98rpx;
+ .cover {
+ position: absolute;
+ left: 30rpx;
+ top: 30rpx;
+ width: 98rpx;
+ height: 98rpx;
+ border-radius: 50%;
+ }
+ .user {
+ color: rgba($color: white, $alpha: 0.7);
+ line-height: 58rpx;
+ font-size: $title-size-lg;
+ }
+ .sub-time {
+ line-height: 40rpx;
+ color: #e6ce9e;
+ font-size: $title-size-sm;
+ }
+ .btn {
+ position: absolute;
+ color: #261f0f;
+ background: #e6ce9e;
+ width: 160rpx;
+ border-radius: 30rpx;
+ font-size: $title-size-m;
+ right: 30rpx;
+ top: 50rpx;
+ line-height: 58rpx;
+ text-align: center;
+ }
+ }
+ }
+ .cards-angle {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ z-index: 3;
+ }
+ &::after {
+ content: ' ';
+ height: 70rpx;
+ background: #b29671;
+ position: absolute;
+ width: 100%;
+ bottom: 0;
+ border-radius: $radius/2;
+ z-index: 0;
+ }
+}
+// tabs
+.tabs {
+ background: #1f1b1c;
+ color: white;
+ padding: 0 0 $padding 0;
+ display: flex;
+ justify-content: center;
+ font-size: $title-size-lg;
+ .item {
+ margin: 0 $margin;
+ line-height: 70rpx;
+ height: 70rpx;
+ color: rgba($color: white, $alpha: 0.6);
+ &.show {
+ position: relative;
+ font-weight: bold;
+ font-size: $title-size;
+ color: white;
+ &::after {
+ position: absolute;
+ bottom: 0;
+ left: 20%;
+ width: 60%;
+ height: 6rpx;
+ border-radius: 3rpx;
+ content: ' ';
+ background: white;
+ }
+ }
+ }
+}
+
diff --git a/pages/wxAuth/wxAuth.vue b/pages/wxAuth/wxAuth.vue
new file mode 100644
index 0000000..251602e
--- /dev/null
+++ b/pages/wxAuth/wxAuth.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
diff --git a/router/index.js b/router/index.js
index 4b8717c..2c5b68b 100644
--- a/router/index.js
+++ b/router/index.js
@@ -28,6 +28,12 @@ const router = createRouter({
// 全局路由前置守卫
router.beforeEach((to, from, next) => {
const token = store.getters.getToken || uni.getStorageSync('token')
+ // 检查是否需要微信授权
+ if(store.getters.getCode === '' && to.name != 'wxAuth'){
+ next({
+ name: 'wxAuth'
+ })
+ }
// 检查是否需要登录
if(to.auth && token === ''){
next({
diff --git a/store/index.js b/store/index.js
index 9e3927a..4483f7e 100644
--- a/store/index.js
+++ b/store/index.js
@@ -13,6 +13,7 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
token : uni.getStorageSync('token') || '',
+ code : uni.getStorageSync('wxCode') || '',
coupongoods : []
},
getters: {
@@ -21,6 +22,9 @@ export default new Vuex.Store({
},
getCoupongoods: state => {
return state.coupongoods
+ },
+ getCode: state => {
+ return state.code
}
},
mutations: {
@@ -30,6 +34,10 @@ export default new Vuex.Store({
},
setCoupongoods(state, value) {
state.coupongoods = value
+ },
+ setCode(state, value) {
+ state.code = value
+ uni.setStorageSync('wxCode', value)
}
}
})
diff --git a/unpackage/dist/build/h5/index.html b/unpackage/dist/build/h5/index.html
index bc22657..1399c72 100644
--- a/unpackage/dist/build/h5/index.html
+++ b/unpackage/dist/build/h5/index.html
@@ -1,2 +1,2 @@
链商星球
\ No newline at end of file
+ document.write('')