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/empty */
|
||||
|
||||
/*! @antmjs/vantui/es/icon */
|
||||
|
||||
/*! @antmjs/vantui/es/image */
|
||||
@@ -76,6 +78,10 @@
|
||||
!*** ./node_modules/@antmjs/vantui/es/tabs/wxs.js ***!
|
||||
\****************************************************/
|
||||
|
||||
/*!*****************************************************!*\
|
||||
!*** ./node_modules/@antmjs/vantui/es/empty/wxs.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/empty/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 ***!
|
||||
\********************************************************************************************************************************************************************************************************************/
|
||||
.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 ***!
|
||||
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
@@ -67,3 +71,8 @@
|
||||
position: relative;
|
||||
left: -245rpx;
|
||||
}
|
||||
|
||||
.customImage {
|
||||
width: 100%;
|
||||
height: 230rpx;
|
||||
}
|
||||
|
||||
@@ -38,4 +38,11 @@
|
||||
left: -245px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.customImage{
|
||||
width: 100%;
|
||||
// height: 200px;
|
||||
height: 230px;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
Card,
|
||||
Cell,
|
||||
Col,
|
||||
Empty,
|
||||
Icon,
|
||||
Row,
|
||||
Tabbar,
|
||||
@@ -33,11 +34,12 @@ const my = (props: any) => {
|
||||
// const [active, setActive] = react.useState(props?.active ?? 0);
|
||||
|
||||
const [userInfo, setuserInfo] = useState({}); //用户信息
|
||||
const [openId, setopenId] = useState(""); //用户信息
|
||||
const [activeidArr, setactiveidArr] = useState<any>([]); //用户参与的活动
|
||||
|
||||
const [detailsData, setdetailsData] = useState<any>([]); //活动详情
|
||||
const [currentIndex, setcurrentIndex] = useState(0);
|
||||
const [isin, setisin] = useState(true); //0初始 1未登录 2有手机号
|
||||
const [activeidArr , setactiveidArr ] = useState<any>([]); //用户参与的活动
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getok();
|
||||
@@ -49,57 +51,66 @@ const my = (props: any) => {
|
||||
|
||||
const getok = async () => {
|
||||
let isOk: any = await phoneLogin();
|
||||
console.log("isok", isOk);
|
||||
setisin(isOk);
|
||||
// setisin(isOk?'2':'1');
|
||||
};
|
||||
|
||||
// 云函数,-获取手机号
|
||||
const getLogin = (e: any) => {
|
||||
Taro.cloud
|
||||
.callFunction({
|
||||
name: "getPhoneNum",
|
||||
data: {
|
||||
weRunData: Taro.cloud.CloudID(e.detail.cloudID),
|
||||
},
|
||||
})
|
||||
.then((res: any) => {
|
||||
console.log("res222", res);
|
||||
let phoneNumber = res?.result?.event?.weRunData?.data?.phoneNumber;
|
||||
let tencentcloud_uin = res?.result?.context?.tencentcloud_uin;
|
||||
let openId: any = res?.result?.event?.userInfo?.openId;
|
||||
let postData = {
|
||||
useEffect(() => {
|
||||
if (isin) {
|
||||
// 获取当前用户信息
|
||||
getUserInfo();
|
||||
}
|
||||
}, [isin]);
|
||||
|
||||
// 获取用户
|
||||
const getUserInfo = () => {
|
||||
Taro.cloud.callFunction({
|
||||
name: "getOpenid",
|
||||
complete: async (res: any) => {
|
||||
console.log("callFunction test result: ", res);
|
||||
let openid = res?.result?.event?.userInfo?.openId;
|
||||
setopenId(openid);
|
||||
let objParams = {
|
||||
tableName: "userInfo",
|
||||
keyValue: { openId: openId },
|
||||
okFun: (res: any) => {
|
||||
console.log("q", res);
|
||||
updateTableid({
|
||||
id: res?.data?.[0]?._id,
|
||||
tableName: "userInfo",
|
||||
objData: {
|
||||
tencentcloud_uin: tencentcloud_uin, //微信号
|
||||
authInfo: {
|
||||
authPhonenum: phoneNumber, //手机号
|
||||
},
|
||||
},
|
||||
okFun: (res: any) => {
|
||||
getok();
|
||||
},
|
||||
});
|
||||
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||
keyValue: { openId: openid },
|
||||
okFun: (res) => {
|
||||
console.log("userinfo--", res);
|
||||
setuserInfo(res?.data?.[0] ?? {});
|
||||
setactiveidArr(res?.data?.activeidArr ?? []);
|
||||
|
||||
// 获取当前用户参与的活动
|
||||
getDetails(openid);
|
||||
},
|
||||
};
|
||||
getTable({ ...postData });
|
||||
|
||||
// setisin(true);
|
||||
});
|
||||
getTable(objParams);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
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",
|
||||
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||
keyValue: {
|
||||
...newKey,
|
||||
},
|
||||
okFun: (res) => {
|
||||
console.log("details--", res);
|
||||
console.log("detailsData/usero--", res);
|
||||
setdetailsData(res?.data ?? []);
|
||||
},
|
||||
};
|
||||
@@ -111,53 +122,42 @@ const my = (props: any) => {
|
||||
definePageConfig({
|
||||
navigationBarTitleText: "我的",
|
||||
});
|
||||
|
||||
// 获取活动详情
|
||||
// getDetails();
|
||||
}, []);
|
||||
|
||||
const CardCom = () => {
|
||||
// console.log("details===", details);
|
||||
|
||||
return (
|
||||
<View>
|
||||
{detailsData.splice(0, 2).map((item: any, index: any) => {
|
||||
return (
|
||||
<View
|
||||
onClick={() => {
|
||||
console.log("Card");
|
||||
Taro.navigateTo({
|
||||
url: `/pages/activityList/components/details/index?id=${item?._id}`,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{/* 活动卡片 */}
|
||||
<ActiveCard dataSource={item} />
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
{detailsData?.length>0 ? (
|
||||
<View>
|
||||
{detailsData.splice(0, 2).map((item: any, index: any) => {
|
||||
return (
|
||||
<View
|
||||
onClick={() => {
|
||||
console.log("Card");
|
||||
Taro.navigateTo({
|
||||
url: `/pages/activityList/components/details/index?id=${item?._id}`,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{/* 活动卡片 */}
|
||||
<ActiveCard dataSource={item} />
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
) : (
|
||||
<View>
|
||||
<Empty
|
||||
className="customImage"
|
||||
image="https://img.yzcdn.cn/vant/custom-empty-image.png"
|
||||
// description="描述文字"
|
||||
/>
|
||||
</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 (
|
||||
<View className="myContent">
|
||||
{/* <View className={styles?.myContent}> */}
|
||||
@@ -178,7 +178,7 @@ const my = (props: any) => {
|
||||
size="mini"
|
||||
open-type="getPhoneNumber"
|
||||
lang="zh_CN"
|
||||
onGetPhoneNumber={onGetPhoneNumber}
|
||||
// onGetPhoneNumber={onGetPhoneNumber}
|
||||
>
|
||||
登录
|
||||
</Button>
|
||||
@@ -192,17 +192,24 @@ const my = (props: any) => {
|
||||
active={currentIndex}
|
||||
onClick={(e: any) => {
|
||||
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>
|
||||
</Tab>
|
||||
{/* <Tab title="已报名">
|
||||
<View>222</View>
|
||||
</Tab> */}
|
||||
<Tab title="待参加">333</Tab>
|
||||
<Tab title="已结束">44</Tab>
|
||||
<Tab title="待参加" name="2">
|
||||
{CardCom()}
|
||||
</Tab>
|
||||
<Tab title="已取消" name="4">
|
||||
{CardCom()}
|
||||
</Tab>
|
||||
{/* <Tab title="已结束" name='4'>44</Tab> */}
|
||||
</Tabs>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user