feat: 待审核
This commit is contained in:
2
dist/pages/my/index.js
vendored
2
dist/pages/my/index.js
vendored
File diff suppressed because one or more lines are too long
10
dist/pages/my/index.js.LICENSE.txt
vendored
10
dist/pages/my/index.js.LICENSE.txt
vendored
@@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
/*! @antmjs/vantui/es/cell */
|
/*! @antmjs/vantui/es/cell */
|
||||||
|
|
||||||
|
/*! @antmjs/vantui/es/empty */
|
||||||
|
|
||||||
/*! @antmjs/vantui/es/icon */
|
/*! @antmjs/vantui/es/icon */
|
||||||
|
|
||||||
/*! @antmjs/vantui/es/image */
|
/*! @antmjs/vantui/es/image */
|
||||||
@@ -76,6 +78,10 @@
|
|||||||
!*** ./node_modules/@antmjs/vantui/es/tabs/wxs.js ***!
|
!*** ./node_modules/@antmjs/vantui/es/tabs/wxs.js ***!
|
||||||
\****************************************************/
|
\****************************************************/
|
||||||
|
|
||||||
|
/*!*****************************************************!*\
|
||||||
|
!*** ./node_modules/@antmjs/vantui/es/empty/wxs.js ***!
|
||||||
|
\*****************************************************/
|
||||||
|
|
||||||
/*!*****************************************************!*\
|
/*!*****************************************************!*\
|
||||||
!*** ./node_modules/@antmjs/vantui/es/tab/index.js ***!
|
!*** ./node_modules/@antmjs/vantui/es/tab/index.js ***!
|
||||||
\*****************************************************/
|
\*****************************************************/
|
||||||
@@ -88,6 +94,10 @@
|
|||||||
!*** ./node_modules/@antmjs/vantui/es/tabs/index.js ***!
|
!*** ./node_modules/@antmjs/vantui/es/tabs/index.js ***!
|
||||||
\******************************************************/
|
\******************************************************/
|
||||||
|
|
||||||
|
/*!*******************************************************!*\
|
||||||
|
!*** ./node_modules/@antmjs/vantui/es/empty/index.js ***!
|
||||||
|
\*******************************************************/
|
||||||
|
|
||||||
/*!********************************************************!*\
|
/*!********************************************************!*\
|
||||||
!*** ./node_modules/@antmjs/vantui/es/sticky/index.js ***!
|
!*** ./node_modules/@antmjs/vantui/es/sticky/index.js ***!
|
||||||
\********************************************************/
|
\********************************************************/
|
||||||
|
|||||||
9
dist/pages/my/index.wxss
vendored
9
dist/pages/my/index.wxss
vendored
@@ -10,6 +10,10 @@
|
|||||||
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[2]!./node_modules/@antmjs/vantui/es/tab/index.css ***!
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[2]!./node_modules/@antmjs/vantui/es/tab/index.css ***!
|
||||||
\********************************************************************************************************************************************************************************************************************/
|
\********************************************************************************************************************************************************************************************************************/
|
||||||
.van-tab__pane{box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch;-webkit-flex-shrink:0;flex-shrink:0;width:100%}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible}
|
.van-tab__pane{box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch;-webkit-flex-shrink:0;flex-shrink:0;width:100%}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible}
|
||||||
|
/*!**********************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[0].use[2]!./node_modules/@antmjs/vantui/es/empty/index.css ***!
|
||||||
|
\**********************************************************************************************************************************************************************************************************************/
|
||||||
|
.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:64rpx 0}.van-empty__image{width:320rpx;height:320rpx}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:32rpx;padding:0 120rpx;color:#969799;font-size:28rpx;line-height:40rpx}.van-empty__description:empty{display:none}.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:48rpx}
|
||||||
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** css ./node_modules/cache-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[3]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[5]!./src/pages/my/index.module.scss ***!
|
!*** css ./node_modules/cache-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[3]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[5]!./src/pages/my/index.module.scss ***!
|
||||||
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
@@ -67,3 +71,8 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
left: -245rpx;
|
left: -245rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.customImage {
|
||||||
|
width: 100%;
|
||||||
|
height: 230rpx;
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,3 +39,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.customImage{
|
||||||
|
width: 100%;
|
||||||
|
// height: 200px;
|
||||||
|
height: 230px;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Cell,
|
Cell,
|
||||||
Col,
|
Col,
|
||||||
|
Empty,
|
||||||
Icon,
|
Icon,
|
||||||
Row,
|
Row,
|
||||||
Tabbar,
|
Tabbar,
|
||||||
@@ -33,11 +34,12 @@ const my = (props: any) => {
|
|||||||
// const [active, setActive] = react.useState(props?.active ?? 0);
|
// const [active, setActive] = react.useState(props?.active ?? 0);
|
||||||
|
|
||||||
const [userInfo, setuserInfo] = useState({}); //用户信息
|
const [userInfo, setuserInfo] = useState({}); //用户信息
|
||||||
|
const [openId, setopenId] = useState(""); //用户信息
|
||||||
|
const [activeidArr, setactiveidArr] = useState<any>([]); //用户参与的活动
|
||||||
|
|
||||||
const [detailsData, setdetailsData] = useState<any>([]); //活动详情
|
const [detailsData, setdetailsData] = useState<any>([]); //活动详情
|
||||||
const [currentIndex, setcurrentIndex] = useState(0);
|
const [currentIndex, setcurrentIndex] = useState(0);
|
||||||
const [isin, setisin] = useState(true); //0初始 1未登录 2有手机号
|
const [isin, setisin] = useState(true); //0初始 1未登录 2有手机号
|
||||||
const [activeidArr , setactiveidArr ] = useState<any>([]); //用户参与的活动
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getok();
|
getok();
|
||||||
@@ -49,57 +51,66 @@ const my = (props: any) => {
|
|||||||
|
|
||||||
const getok = async () => {
|
const getok = async () => {
|
||||||
let isOk: any = await phoneLogin();
|
let isOk: any = await phoneLogin();
|
||||||
console.log("isok", isOk);
|
|
||||||
setisin(isOk);
|
setisin(isOk);
|
||||||
// setisin(isOk?'2':'1');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 云函数,-获取手机号
|
useEffect(() => {
|
||||||
const getLogin = (e: any) => {
|
if (isin) {
|
||||||
Taro.cloud
|
// 获取当前用户信息
|
||||||
.callFunction({
|
getUserInfo();
|
||||||
name: "getPhoneNum",
|
}
|
||||||
data: {
|
}, [isin]);
|
||||||
weRunData: Taro.cloud.CloudID(e.detail.cloudID),
|
|
||||||
},
|
// 获取用户
|
||||||
})
|
const getUserInfo = () => {
|
||||||
.then((res: any) => {
|
Taro.cloud.callFunction({
|
||||||
console.log("res222", res);
|
name: "getOpenid",
|
||||||
let phoneNumber = res?.result?.event?.weRunData?.data?.phoneNumber;
|
complete: async (res: any) => {
|
||||||
let tencentcloud_uin = res?.result?.context?.tencentcloud_uin;
|
console.log("callFunction test result: ", res);
|
||||||
let openId: any = res?.result?.event?.userInfo?.openId;
|
let openid = res?.result?.event?.userInfo?.openId;
|
||||||
let postData = {
|
setopenId(openid);
|
||||||
|
let objParams = {
|
||||||
tableName: "userInfo",
|
tableName: "userInfo",
|
||||||
keyValue: { openId: openId },
|
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||||
okFun: (res: any) => {
|
keyValue: { openId: openid },
|
||||||
console.log("q", res);
|
okFun: (res) => {
|
||||||
updateTableid({
|
console.log("userinfo--", res);
|
||||||
id: res?.data?.[0]?._id,
|
setuserInfo(res?.data?.[0] ?? {});
|
||||||
tableName: "userInfo",
|
setactiveidArr(res?.data?.activeidArr ?? []);
|
||||||
objData: {
|
|
||||||
tencentcloud_uin: tencentcloud_uin, //微信号
|
// 获取当前用户参与的活动
|
||||||
authInfo: {
|
getDetails(openid);
|
||||||
authPhonenum: phoneNumber, //手机号
|
|
||||||
},
|
|
||||||
},
|
|
||||||
okFun: (res: any) => {
|
|
||||||
getok();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
getTable({ ...postData });
|
getTable(objParams);
|
||||||
|
},
|
||||||
// setisin(true);
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = () => {
|
// 获取该用户所有活动详情
|
||||||
let objParams = {
|
const getDetails = (openid: any, status?: string) => {
|
||||||
|
const db: any = Taro.cloud.database({});
|
||||||
|
const _: any = db.command;
|
||||||
|
let newKey: any = status
|
||||||
|
? {
|
||||||
|
peopleArr: _.elemMatch({
|
||||||
|
openid: _.eq(openid),
|
||||||
|
status: _.eq(status), //审核通过的数据
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
peopleArr: _.elemMatch({
|
||||||
|
openid: _.eq(openid),
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
let objParams: any = {
|
||||||
tableName: "details",
|
tableName: "details",
|
||||||
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||||
|
keyValue: {
|
||||||
|
...newKey,
|
||||||
|
},
|
||||||
okFun: (res) => {
|
okFun: (res) => {
|
||||||
console.log("details--", res);
|
console.log("detailsData/usero--", res);
|
||||||
setdetailsData(res?.data ?? []);
|
setdetailsData(res?.data ?? []);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -111,53 +122,42 @@ const my = (props: any) => {
|
|||||||
definePageConfig({
|
definePageConfig({
|
||||||
navigationBarTitleText: "我的",
|
navigationBarTitleText: "我的",
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取活动详情
|
|
||||||
// getDetails();
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const CardCom = () => {
|
const CardCom = () => {
|
||||||
// console.log("details===", details);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
{detailsData.splice(0, 2).map((item: any, index: any) => {
|
{detailsData?.length>0 ? (
|
||||||
return (
|
<View>
|
||||||
<View
|
{detailsData.splice(0, 2).map((item: any, index: any) => {
|
||||||
onClick={() => {
|
return (
|
||||||
console.log("Card");
|
<View
|
||||||
Taro.navigateTo({
|
onClick={() => {
|
||||||
url: `/pages/activityList/components/details/index?id=${item?._id}`,
|
console.log("Card");
|
||||||
});
|
Taro.navigateTo({
|
||||||
}}
|
url: `/pages/activityList/components/details/index?id=${item?._id}`,
|
||||||
>
|
});
|
||||||
{/* 活动卡片 */}
|
}}
|
||||||
<ActiveCard dataSource={item} />
|
>
|
||||||
</View>
|
{/* 活动卡片 */}
|
||||||
);
|
<ActiveCard dataSource={item} />
|
||||||
})}
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View>
|
||||||
|
<Empty
|
||||||
|
className="customImage"
|
||||||
|
image="https://img.yzcdn.cn/vant/custom-empty-image.png"
|
||||||
|
// description="描述文字"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取用户信息 [头像/昵称]
|
|
||||||
const onGetUserInfo = (info: any) => {
|
|
||||||
console.log("info", info);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取用户手机 [手机号]-需要揭秘
|
|
||||||
const onGetPhoneNumber = (info: any) => {
|
|
||||||
console.log("info", info);
|
|
||||||
getPhoneNumber(info);
|
|
||||||
// Taro.cloud.openapi.phonenumber.getPhoneNumber({code:'code'})
|
|
||||||
};
|
|
||||||
|
|
||||||
const getPhoneNumber = (e: any) => {
|
|
||||||
console.log("点击获取手机事件", e.detail.cloudID);
|
|
||||||
// 调用云函数获取手机号
|
|
||||||
getLogin(e);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="myContent">
|
<View className="myContent">
|
||||||
{/* <View className={styles?.myContent}> */}
|
{/* <View className={styles?.myContent}> */}
|
||||||
@@ -178,7 +178,7 @@ const my = (props: any) => {
|
|||||||
size="mini"
|
size="mini"
|
||||||
open-type="getPhoneNumber"
|
open-type="getPhoneNumber"
|
||||||
lang="zh_CN"
|
lang="zh_CN"
|
||||||
onGetPhoneNumber={onGetPhoneNumber}
|
// onGetPhoneNumber={onGetPhoneNumber}
|
||||||
>
|
>
|
||||||
登录
|
登录
|
||||||
</Button>
|
</Button>
|
||||||
@@ -192,17 +192,24 @@ const my = (props: any) => {
|
|||||||
active={currentIndex}
|
active={currentIndex}
|
||||||
onClick={(e: any) => {
|
onClick={(e: any) => {
|
||||||
console.log("e", e);
|
console.log("e", e);
|
||||||
setcurrentIndex(e?.detail?.index ?? 0);
|
getDetails(openId, e?.detail?.name);
|
||||||
|
setcurrentIndex(e?.detail?.name);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tab title="待审核">
|
{/* <Tab title={`待审核 ${detailsData?.length??0}`} name="1"> */}
|
||||||
|
<Tab title={`待审核`} name="1">
|
||||||
<View>{CardCom()}</View>
|
<View>{CardCom()}</View>
|
||||||
</Tab>
|
</Tab>
|
||||||
{/* <Tab title="已报名">
|
{/* <Tab title="已报名">
|
||||||
<View>222</View>
|
<View>222</View>
|
||||||
</Tab> */}
|
</Tab> */}
|
||||||
<Tab title="待参加">333</Tab>
|
<Tab title="待参加" name="2">
|
||||||
<Tab title="已结束">44</Tab>
|
{CardCom()}
|
||||||
|
</Tab>
|
||||||
|
<Tab title="已取消" name="4">
|
||||||
|
{CardCom()}
|
||||||
|
</Tab>
|
||||||
|
{/* <Tab title="已结束" name='4'>44</Tab> */}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user