From 5b89459951931423a94ec50c876bc35a46d91a6e Mon Sep 17 00:00:00 2001
From: Jruome <2559028966@qq.com>
Date: Thu, 18 May 2023 18:03:06 +0800
Subject: [PATCH] =?UTF-8?q?uniapp=20=E8=B4=AD=E4=B9=B0=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yudao-ui-app/api/member.js | 4 +-
yudao-ui-app/pages.json | 8 +-
.../pages/member_application/index.vue | 245 +++++------
yudao-ui-app/pages/member_equity/index.vue | 156 +++++--
yudao-ui-app/pages/member_others/index.vue | 387 ++++++++++++------
yudao-ui-app/pages/member_record/index.vue | 77 ++--
yudao-ui-app/pages/member_renew/index.vue | 302 +++++++++-----
yudao-ui-app/pages/users/login/index.vue | 2 +
8 files changed, 784 insertions(+), 397 deletions(-)
diff --git a/yudao-ui-app/api/member.js b/yudao-ui-app/api/member.js
index 182262073..8e1f99336 100644
--- a/yudao-ui-app/api/member.js
+++ b/yudao-ui-app/api/member.js
@@ -11,8 +11,8 @@ export function memberGradeInfo(){
/**
* 获取当前登录账号的充值记录
*/
-export function memberHeadInfo(){
- return request.get('api/order/member/memberHeadInfo', {},{noAuth:true})
+export function memberOrderInfo(){
+ return request.get('api/order/member/memberOrderInfo', {},{noAuth:true})
}
/**
diff --git a/yudao-ui-app/pages.json b/yudao-ui-app/pages.json
index 911bdef5f..25c9a715e 100644
--- a/yudao-ui-app/pages.json
+++ b/yudao-ui-app/pages.json
@@ -573,11 +573,17 @@
"text": "分类"
},
{
- "pagePath": "pages/member_application/index",
+ "pagePath": "pages/member_record/index",
"iconPath": "static/images/2-001.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",
+ // "text": "会员申请"
+ // },
{
"pagePath": "pages/order_addcart/order_addcart",
"iconPath": "static/images/3-001.png",
diff --git a/yudao-ui-app/pages/member_application/index.vue b/yudao-ui-app/pages/member_application/index.vue
index faa53b235..e26a09936 100644
--- a/yudao-ui-app/pages/member_application/index.vue
+++ b/yudao-ui-app/pages/member_application/index.vue
@@ -1,23 +1,16 @@
-
-
-
-
-
-
-
-
-
-
-
+
- 办理240得360元
- 办理档次【240】元,可享连续12个月每个月返利30元
+
+ {{item.name.split('得')[0]}}得{{item.name.split('得')[1]}}
+
+
+ {{item.gearRemarks}}
@@ -39,6 +32,7 @@
memberGradeInfo
} from '@/api/member.js';
import paymentMember from '@/components/paymentMember';
+import store from '@/store/index';
export default {
name: "member_application",
components: {
@@ -46,18 +40,7 @@
},
data() {
return {
- total_fee: 1, // 支付金额,单位分 100 = 1元
- order_no: "", // 业务系统订单号(即你自己业务系统的订单表的订单号)
- out_trade_no: "", // 插件支付单号
- description: "测试订单", // 支付描述
- type: "test", // 支付回调类型 如 recharge 代表余额充值 goods 代表商品订单(可自定义,任意英文单词都可以,只要你在 uni-pay-co/notify/目录下创建对应的 xxx.js文件进行编写对应的回调逻辑即可)
- custom:{
- a: "a",
- b: 1
- },
- form: {
- phone:''
- },
+ memberData:[],
payInfo:{
userPhone: '',
confirmPhone: '',
@@ -77,50 +60,44 @@
}
],
pay_close: false,
- rules: {
- phone: [
- {
- required: true,
- message: '手机号不能为空',
- // 触发器可以同时用blur和change
- trigger: ['change', 'blur']
- },
- {
- pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[1-25-9])\d{8}$/g,
- // 正则检验前先将值转为字符串
- transform(value) {
- return String(value);
- },
- message: '手机号不正确(190.193号段不可充值)',
- trigger: ['change', 'blur']
- },
- ]
- }
- };
- },
- mounted() {
+ activeIndex:[],
+ form: {
+ phone:''
+ },
+ };
},
async onLoad() {
const res = await memberGradeInfo()
+ this.memberData = res.data
},
methods: {
+ handleMember(value,index){
+ if(!!parseInt(value.isExist)) return
+ if(this.activeIndex.includes(index)){
+ this.activeIndex = this.activeIndex.filter(item => item !== index)
+ }else{
+ this.activeIndex.push(index)
+ }
+ },
/**
* 打开支付组件
*
*/
goPay() {
- this.$set(this, 'pay_close', true);
+ if(this.activeIndex.length){
+ this.$set(this, 'pay_close', true);
+ const orderInfos = this.activeIndex.map((item) => {
+ return {
+ ...this.memberData[item],
+ gearId:this.memberData[item].id
+ }
+ })
this.payInfo = {
- userPhone: '15760696662',
- confirmPhone: '15760696662',
- orderInfos: [{
- gearId: '1',
- name: '套餐1',
- gearRemarks: '备注1',
- gearAmount: 0.01
- }]
+ userPhone: store.state.app.userInfo.mobile,
+ orderInfos
}
+ }
},
/**
* 事件回调
@@ -163,70 +140,34 @@
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
- submit() {
- this.order_no = `test`+Date.now(); // 模拟生成订单号
- this.out_trade_no = `${this.order_no}-1`; // 模拟生成插件支付单号
- // 打开支付收银台
- this.$refs.uniPay.open({
- total_fee: this.total_fee, // 支付金额,单位分 100 = 1元
- order_no: this.order_no, // 业务系统订单号(即你自己业务系统的订单表的订单号)
- out_trade_no: this.out_trade_no, // 插件支付单号
- description: this.description, // 支付描述
- type: this.type, // 支付回调类型
- custom: this.custom, // 自定义数据
- });
-
- // this.$refs.uForm.validate().then(res => {
- // uni.$u.toast('校验通过')
- // }).catch(errors => {
- // uni.$u.toast('校验失败')
- // })
- }
}
};
diff --git a/yudao-ui-app/pages/member_equity/index.vue b/yudao-ui-app/pages/member_equity/index.vue
index cd3629055..7564d02e2 100644
--- a/yudao-ui-app/pages/member_equity/index.vue
+++ b/yudao-ui-app/pages/member_equity/index.vue
@@ -11,45 +11,44 @@
-
- 立即续费
-
+ 会员等级3级
+
- 我的会员权益
+ 我的会员权益
查看权益>
-
+
@@ -102,20 +101,30 @@
diff --git a/yudao-ui-app/pages/member_record/index.vue b/yudao-ui-app/pages/member_record/index.vue
index 713dd712f..c239bddd2 100644
--- a/yudao-ui-app/pages/member_record/index.vue
+++ b/yudao-ui-app/pages/member_record/index.vue
@@ -1,30 +1,54 @@
-
-
- 充值号码:13627451300
+
+
+
+
+ 充值号码:{{item.userPhone}}
+
- 充值档次:套餐1
- 日期:2023-05-12
+ 充值档次:{{item.grade}}
+ 日期:{{item.createTime}}
diff --git a/yudao-ui-app/pages/users/login/index.vue b/yudao-ui-app/pages/users/login/index.vue
index e6894e397..a16212ec7 100644
--- a/yudao-ui-app/pages/users/login/index.vue
+++ b/yudao-ui-app/pages/users/login/index.vue
@@ -129,6 +129,7 @@
let data = res.data;
let newTime = Math.round(new Date() / 1000);
this.$store.commit("LOGIN", {
+ 'userId':data.userId,
'token': res.data.accessToken,
'refreshToken': res.data.refreshToken
});
@@ -231,6 +232,7 @@
data
}) => {
this.$store.commit("LOGIN", {
+ 'userId':data.userId,
'token': data.accessToken,
'refreshToken': data.refreshToken
});