Merge branch 'master' of https://gitea.zianxin.com/zax/Friendship-and-chat-uniapp
This commit is contained in:
commit
5bc4660b93
12 files changed
+522
-379
No files matched your search
+185
-167
@@ -1,39 +1,39 @@
|
||||
{
|
||||
"name" : "荷塘月色",
|
||||
"appid" : "__UNI__5B53E65",
|
||||
"description" : "聊天交友app",
|
||||
"versionName" : "0.0.0",
|
||||
"versionCode" : 1,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueCompiler" : "uni-app",
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"nvueLaunchMode" : "fast",
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
"name": "荷塘月色",
|
||||
"appid": "__UNI__5B53E65",
|
||||
"description": "聊天交友app",
|
||||
"versionName": "0.0.0",
|
||||
"versionCode": 1,
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
"nvueCompiler": "uni-app",
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"nvueLaunchMode": "fast",
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
},
|
||||
"safearea" : {
|
||||
"bottom" : {
|
||||
"offset" : "none"
|
||||
"safearea": {
|
||||
"bottom": {
|
||||
"offset": "none"
|
||||
}
|
||||
},
|
||||
"modules" : {
|
||||
"Payment" : {},
|
||||
"Share" : {},
|
||||
"VideoPlayer" : {},
|
||||
"OAuth" : {},
|
||||
"Camera" : {},
|
||||
"Geolocation" : {},
|
||||
"FaceID" : {}
|
||||
"modules": {
|
||||
"Payment": {},
|
||||
"Share": {},
|
||||
"VideoPlayer": {},
|
||||
"OAuth": {},
|
||||
"Camera": {},
|
||||
"Geolocation": {},
|
||||
"FaceID": {}
|
||||
},
|
||||
"distribute" : {
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"distribute": {
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
@@ -66,184 +66,202 @@
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"
|
||||
],
|
||||
"minSdkVersion" : 21,
|
||||
"schemes" : "荷塘月色",
|
||||
"excludePermissions" : [
|
||||
"minSdkVersion": 21,
|
||||
"schemes": "荷塘月色",
|
||||
"excludePermissions": [
|
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>"
|
||||
]
|
||||
},
|
||||
"ios" : {
|
||||
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
|
||||
"dSYMs" : false,
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
|
||||
"NSPhotoLibraryAddUsageDescription" : "需要同意访问您的相册才能保存该图片",
|
||||
"NSCameraUsageDescription" : "需要同意访问您的摄像头拍摄照片才能完善该条目",
|
||||
"NSUserTrackingUsageDescription" : "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验"
|
||||
"ios": {
|
||||
"urlschemewhitelist": [
|
||||
"baidumap",
|
||||
"iosamap"
|
||||
],
|
||||
"dSYMs": false,
|
||||
"privacyDescription": {
|
||||
"NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目",
|
||||
"NSPhotoLibraryAddUsageDescription": "需要同意访问您的相册才能保存该图片",
|
||||
"NSCameraUsageDescription": "需要同意访问您的摄像头拍摄照片才能完善该条目",
|
||||
"NSUserTrackingUsageDescription": "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验"
|
||||
},
|
||||
"urltypes" : "荷塘月色",
|
||||
"capabilities" : {
|
||||
"entitlements" : {
|
||||
"com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ]
|
||||
"urltypes": "荷塘月色",
|
||||
"capabilities": {
|
||||
"entitlements": {
|
||||
"com.apple.developer.associated-domains": [
|
||||
"applinks:shopro.sheepjs.com"
|
||||
]
|
||||
}
|
||||
},
|
||||
"idfa" : true
|
||||
"idfa": true
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"speech" : {},
|
||||
"ad" : {},
|
||||
"oauth" : {},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appid" : "wx2b4e4d3feff8267f",
|
||||
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
||||
"sdkConfigs": {
|
||||
"speech": {},
|
||||
"ad": {},
|
||||
"oauth": {},
|
||||
"payment": {
|
||||
"weixin": {
|
||||
"__platform__": [
|
||||
"ios",
|
||||
"android"
|
||||
],
|
||||
"appid": "wx2b4e4d3feff8267f",
|
||||
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
||||
},
|
||||
"alipay" : {
|
||||
"__platform__" : [ "ios", "android" ]
|
||||
"alipay": {
|
||||
"__platform__": [
|
||||
"ios",
|
||||
"android"
|
||||
]
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx2b4e4d3feff8267f",
|
||||
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
||||
"share": {
|
||||
"weixin": {
|
||||
"appid": "wx2b4e4d3feff8267f",
|
||||
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
||||
}
|
||||
},
|
||||
"maps" : {},
|
||||
"geolocation" : {
|
||||
"system" : {
|
||||
"__platform__" : [ "ios", "android" ]
|
||||
"maps": {},
|
||||
"geolocation": {
|
||||
"system": {
|
||||
"__platform__": [
|
||||
"ios",
|
||||
"android"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"orientation" : [ "portrait-primary" ],
|
||||
"splashscreen" : {
|
||||
"androidStyle" : "default",
|
||||
"iosStyle" : "common",
|
||||
"useOriginalMsgbox" : true,
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/1024x1024.png",
|
||||
"xhdpi" : "unpackage/res/icons/1024x1024.png",
|
||||
"xxhdpi" : "unpackage/res/icons/1024x1024.png"
|
||||
"orientation": [
|
||||
"portrait-primary"
|
||||
],
|
||||
"splashscreen": {
|
||||
"androidStyle": "default",
|
||||
"iosStyle": "common",
|
||||
"useOriginalMsgbox": true,
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/1024x1024.png",
|
||||
"xhdpi": "unpackage/res/icons/1024x1024.png",
|
||||
"xxhdpi": "unpackage/res/icons/1024x1024.png"
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"AP-FaceDetectModule" : {
|
||||
"__plugin_info__" : {
|
||||
"name" : "AP-FaceDetectModule",
|
||||
"description" : "阿里云金融级实人认证SDK",
|
||||
"platforms" : "Android,iOS",
|
||||
"url" : "",
|
||||
"android_package_name" : "",
|
||||
"ios_bundle_id" : "",
|
||||
"isCloud" : false,
|
||||
"bought" : -1,
|
||||
"pid" : "",
|
||||
"parameters" : {}
|
||||
"nativePlugins": {
|
||||
"AP-FaceDetectModule": {
|
||||
"__plugin_info__": {
|
||||
"name": "AP-FaceDetectModule",
|
||||
"description": "阿里云金融级实人认证SDK",
|
||||
"platforms": "Android,iOS",
|
||||
"url": "",
|
||||
"android_package_name": "",
|
||||
"ios_bundle_id": "",
|
||||
"isCloud": false,
|
||||
"bought": -1,
|
||||
"pid": "",
|
||||
"parameters": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quickapp" : {},
|
||||
"quickapp-native" : {
|
||||
"icon" : "/static/logo.png",
|
||||
"package" : "com.example.demo",
|
||||
"features" : [
|
||||
"quickapp": {},
|
||||
"quickapp-native": {
|
||||
"icon": "/static/logo.png",
|
||||
"package": "com.example.demo",
|
||||
"features": [
|
||||
{
|
||||
"name" : "system.clipboard"
|
||||
"name": "system.clipboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"quickapp-webview" : {
|
||||
"icon" : "/static/logo.png",
|
||||
"package" : "com.example.demo",
|
||||
"minPlatformVersion" : 1070,
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : 100
|
||||
"quickapp-webview": {
|
||||
"icon": "/static/logo.png",
|
||||
"package": "com.example.demo",
|
||||
"minPlatformVersion": 1070,
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": 100
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx66186af0759f47c9",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"postcss" : true
|
||||
"mp-weixin": {
|
||||
"appid": "wx2b4e4d3feff8267f",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"minified": true,
|
||||
"postcss": true
|
||||
},
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
},
|
||||
"plugins" : {},
|
||||
"lazyCodeLoading" : "requiredComponents",
|
||||
"usingComponents" : {},
|
||||
"permission" : {},
|
||||
"requiredPrivateInfos" : [ "chooseAddress" ]
|
||||
"plugins": {},
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {},
|
||||
"permission": {},
|
||||
"requiredPrivateInfos": [
|
||||
"chooseAddress"
|
||||
]
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-jd" : {
|
||||
"usingComponents" : true
|
||||
"mp-jd": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"h5" : {
|
||||
"darkmode" : true,
|
||||
"template" : "index.html",
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : "/"
|
||||
"h5": {
|
||||
"darkmode": true,
|
||||
"template": "index.html",
|
||||
"router": {
|
||||
"mode": "history",
|
||||
"base": "/"
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"maps" : {}
|
||||
"sdkConfigs": {
|
||||
"maps": {}
|
||||
},
|
||||
"async" : {
|
||||
"timeout" : 20000
|
||||
"async": {
|
||||
"timeout": 20000
|
||||
},
|
||||
"title" : "聊天交友",
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : true
|
||||
"title": "聊天交友",
|
||||
"optimization": {
|
||||
"treeShaking": {
|
||||
"enable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"_spaceID" : "192b4892-5452-4e1d-9f09-eee1ece40639",
|
||||
"locale" : "zh-Hans",
|
||||
"fallbackLocale" : "zh-Hans"
|
||||
}
|
||||
"vueVersion": "3",
|
||||
"_spaceID": "192b4892-5452-4e1d-9f09-eee1ece40639",
|
||||
"locale": "zh-Hans",
|
||||
"fallbackLocale": "zh-Hans"
|
||||
}
|
||||
+44
-14
@@ -43,18 +43,34 @@
|
||||
</view>
|
||||
|
||||
<wd-config-provider theme="dark">
|
||||
<wd-message-box></wd-message-box>
|
||||
<wd-message-box selector="xyBox" />
|
||||
<wd-message-box selector="agreeBox">
|
||||
<view class="flex items-center justify-center flex-wrap px-20rpx text-center text-14px text-white">
|
||||
<text>我已阅读并同意</text>
|
||||
<text class="text-#D29E52 underline underline-1 underline-solid underline-amber" @click="alert(2, '用户协议')">
|
||||
《用户协议》
|
||||
</text>
|
||||
<text>和</text>
|
||||
<text class="text-#D29E52 underline underline-1 underline-solid underline-amber" @click="alert(3, '隐私政策')">
|
||||
《隐私政策》
|
||||
</text>
|
||||
并同意授权
|
||||
</view>
|
||||
</wd-message-box>
|
||||
</wd-config-provider>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
|
||||
import AuthUtil from '@/sheep/api/member/auth';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
|
||||
const message = useMessage();
|
||||
const message = useMessage('xyBox');
|
||||
const agreeMessage = useMessage('agreeBox');
|
||||
|
||||
const phone = ref('');
|
||||
const smsCode = ref('');
|
||||
@@ -62,6 +78,15 @@ const isTiming = ref(false);
|
||||
const countDown = ref(60);
|
||||
const isAgree = ref(false);
|
||||
|
||||
onShow(() => {
|
||||
if (!phone.value) {
|
||||
const lastLoginPhone = uni.getStorageSync('last_login_phone')
|
||||
if (lastLoginPhone) {
|
||||
phone.value = lastLoginPhone
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const handleGetCode = async () => {
|
||||
if (!phone.value) return uni.showToast({ title: '请填写手机号', icon: 'none' });
|
||||
if (
|
||||
@@ -70,14 +95,6 @@ const handleGetCode = async () => {
|
||||
)
|
||||
)
|
||||
return uni.showToast({ title: '手机号格式错误', icon: 'none' });
|
||||
// case 'resetPassword':
|
||||
// scene = 4;
|
||||
// case 'changePassword':
|
||||
// scene = 3;
|
||||
// case 'changeMobile':
|
||||
// scene = 2;
|
||||
// case 'smsLogin':
|
||||
// scene = 1;
|
||||
const { code } = await AuthUtil.sendSmsCode(phone.value, 1);
|
||||
if (code !== 0) return;
|
||||
isTiming.value = true;
|
||||
@@ -101,14 +118,27 @@ const handleLogin = async () => {
|
||||
)
|
||||
return uni.showToast({ title: '手机号格式错误', icon: 'none' });
|
||||
if (!smsCode.value) return uni.showToast({ title: '请填写验证码', icon: 'none' });
|
||||
|
||||
if (!isAgree.value) {
|
||||
uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' });
|
||||
agreeMessage
|
||||
.confirm({
|
||||
title: '授权',
|
||||
confirmButtonText: '同意并登录',
|
||||
})
|
||||
.then(() => {
|
||||
disposeLogin()
|
||||
})
|
||||
return
|
||||
}
|
||||
disposeLogin()
|
||||
};
|
||||
|
||||
const disposeLogin = async () => {
|
||||
if (!phone.value || !smsCode.value) {
|
||||
return;
|
||||
}
|
||||
const { code } = await AuthUtil.smsRegister({ mobile: phone.value, code: smsCode.value });
|
||||
if (code === 0) {
|
||||
uni.setStorageSync('last_login_phone', phone.value);
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.reLaunch({ url: '/pages/wechat-tabbar/index' });
|
||||
// #endif
|
||||
@@ -117,12 +147,11 @@ const handleLogin = async () => {
|
||||
uni.reLaunch({ url: '/pages/tabbar/home' });
|
||||
getApp().$vm.init();
|
||||
// #endif
|
||||
|
||||
return;
|
||||
}
|
||||
// 清理数据,防止缓存未失效
|
||||
getApp().$vm.unloadStore();
|
||||
};
|
||||
}
|
||||
|
||||
// 2-用户协议;3-隐私协议;
|
||||
async function alert(type, title) {
|
||||
@@ -130,6 +159,7 @@ async function alert(type, title) {
|
||||
message.alert({
|
||||
msg: data.content.replace(/<\/?[^>]+>/g, ''),
|
||||
title,
|
||||
zIndex: 200
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -200,6 +200,9 @@ const handleOpenVip = () => {
|
||||
uni.showToast({ title: `不支持${payMethodItem.title}支付`, icon: 'none' });
|
||||
return
|
||||
}
|
||||
|
||||
jumpToWechatPage()
|
||||
return
|
||||
messageBox
|
||||
.confirm({
|
||||
msg: '确认开通?',
|
||||
@@ -238,8 +241,8 @@ const disposeWechatPay = async (openTypeId: any) => {
|
||||
}
|
||||
|
||||
// 跳转到微信小程序
|
||||
const jumpToWechatPage = () => {
|
||||
jumpToWechatMiniProgram("openVip", {
|
||||
const jumpToWechatPage = async () => {
|
||||
await jumpToWechatMiniProgram("openVip", {
|
||||
openTypeId: curOpenTypeId.value,
|
||||
payMethod: payMethod.value
|
||||
})
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
// 跳转到微信小程序
|
||||
const jumpToWechatPage = async (packageId : any) => {
|
||||
console.log("跳转到微信小程序");
|
||||
await jumpToWechatMiniProgram('recharge', {
|
||||
jumpToWechatMiniProgram('recharge', {
|
||||
packageId,
|
||||
payMethod: payMethod.value,
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<wd-cell title="手机号" :value="userInfo?.mobile" />
|
||||
<wd-cell title="设置微信" :value="userInfo?.wechatNum" is-link ellipsis to="/pages/profile/set-wechat" />
|
||||
<wd-cell title="黑名单" is-link ellipsis to="/pages/profile/black-list" />
|
||||
<wd-cell title="客服邮箱" value="1@1.com" is-link ellipsis />
|
||||
<wd-cell title="客服邮箱" value="18917151569@163.com" is-link @tap="copyEmail('18917151569@163.com')" />
|
||||
<wd-cell title="消息推送" value="消息推送" ellipsis>
|
||||
<wd-switch v-model="params.isPush" inactive-color="#777" @change="settingChange" size="20" />
|
||||
</wd-cell>
|
||||
@@ -97,6 +97,15 @@ const beforeChange = ({ value, resolve }: any) => {
|
||||
resolve(true);
|
||||
};
|
||||
|
||||
const copyEmail = (email: string) => {
|
||||
uni.setClipboardData({
|
||||
data: email,
|
||||
success: () => {
|
||||
uni.showToast({ title: '复制成功', icon: 'none', });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
const handleLogout = () => {
|
||||
message
|
||||
|
||||
+104
-145
@@ -15,11 +15,8 @@
|
||||
<scroll-view class="h-[calc(100vh-144rpx)]" scroll-y>
|
||||
<!-- 个人信息 -->
|
||||
<view class="flex items-center p-6">
|
||||
<image
|
||||
:src="userInfo.avatar"
|
||||
class="mr-4 size-100px rounded-full bg-#333 border border-amber border-solid"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image :src="userInfo.avatar" class="mr-4 size-100px rounded-full bg-#333 border border-amber border-solid"
|
||||
mode="aspectFill" />
|
||||
<view class="flex-1">
|
||||
<view class="mb-1 text-base">
|
||||
<text>{{ userInfo.nickname }}</text>
|
||||
@@ -27,18 +24,13 @@
|
||||
</view>
|
||||
<view class="mb-2 text-xs text-#ffffff80 flex items-center">
|
||||
<text>ID: {{ userInfo.id }}</text>
|
||||
<view
|
||||
v-if="userInfo.memberVip?.vip"
|
||||
class="text-20rpx ml-2 flex-row-center bg-color-theme-dark px-1 rounded-1"
|
||||
>
|
||||
<view v-if="userInfo.memberVip?.vip"
|
||||
class="text-20rpx ml-2 flex-row-center bg-color-theme-dark px-1 rounded-1">
|
||||
<uni-icons type="vip-filled" size="14" />
|
||||
<text class="text-color-dark ml-1">VIP</text>
|
||||
</view>
|
||||
</view>
|
||||
<text
|
||||
v-if="userCity?.t"
|
||||
class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1 truncate"
|
||||
>
|
||||
<text v-if="userCity?.t" class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1 truncate">
|
||||
{{ userCity?.t || '' }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -59,11 +51,7 @@
|
||||
<text class="text-color-theme text-sm">喜欢我</text>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<navigator
|
||||
url="/pages/profile/recharge"
|
||||
open-type="navigate"
|
||||
hover-class="navigator-hover"
|
||||
>
|
||||
<navigator url="/pages/profile/recharge" open-type="navigate" hover-class="navigator-hover">
|
||||
<view class="flex-col-center">
|
||||
<text class="text-color-theme font-600 text-lg">
|
||||
{{ fen2yuanSimple(userWallet.balance) }}
|
||||
@@ -76,17 +64,12 @@
|
||||
|
||||
<!-- 开通vip -->
|
||||
<view
|
||||
class="text-color-theme-dark mx-4 p-4 rounded-2 bg-gradient-to-b from-#111 to-#222 b-4 b-solid b-t-#D29E52/60 b-l-#D29E52/40 b-r-#D29E52/40 b-b-#D29E52/20 flex justify-between"
|
||||
>
|
||||
class="text-color-theme-dark mx-4 p-4 rounded-2 bg-gradient-to-b from-#111 to-#222 b-4 b-solid b-t-#D29E52/60 b-l-#D29E52/40 b-r-#D29E52/40 b-b-#D29E52/20 flex justify-between">
|
||||
<view class="font-900 font-italic text-xl">VIP</view>
|
||||
<view class="flex items-center">
|
||||
<text class="text-xs">尊享vip免费特权</text>
|
||||
<navigator
|
||||
v-if="!userInfo.memberVip?.vip"
|
||||
url="/pages/profile/apply-vip"
|
||||
open-type="navigate"
|
||||
hover-class="navigator-hover"
|
||||
>
|
||||
<navigator v-if="!userInfo.memberVip?.vip" url="/pages/profile/apply-vip" open-type="navigate"
|
||||
hover-class="navigator-hover">
|
||||
<text class="ml-4 px-4 py-1 rounded-full text-24rpx bg-color-theme text-black">
|
||||
立即开通
|
||||
</text>
|
||||
@@ -110,11 +93,7 @@
|
||||
<text class="text-xs ml-2">邀请福利</text>
|
||||
<text class="text-20rpx ml-4 mt-2rpx">邀请用户领会员</text>
|
||||
</view>
|
||||
<navigator
|
||||
url="/pages/wechat-tabbar/index"
|
||||
open-type="navigate"
|
||||
hover-class="navigator-hover"
|
||||
>
|
||||
<navigator url="/pages/wechat-tabbar/index" open-type="navigate" hover-class="navigator-hover">
|
||||
<view class="bg-color-theme text-xs rounded-full py-1 px-3">查看福利</view>
|
||||
</navigator>
|
||||
</view>
|
||||
@@ -123,29 +102,14 @@
|
||||
<!-- 菜单 -->
|
||||
<view class="mt-2 mx-1">
|
||||
<wd-cell-group>
|
||||
<wd-cell
|
||||
v-for="(item, index) in MenuCellList"
|
||||
:key="index"
|
||||
:title="item.title"
|
||||
:value="item.value"
|
||||
icon-size="24"
|
||||
:icon="item.icon"
|
||||
is-link
|
||||
ellipsis
|
||||
:to="item.to"
|
||||
@click="item.onClick"
|
||||
/>
|
||||
<wd-cell v-for="(item, index) in MenuCellList" :key="index" :title="item.title" :value="item.value"
|
||||
icon-size="24" :icon="item.icon" is-link ellipsis :to="item.to" @click="item.onClick" />
|
||||
</wd-cell-group>
|
||||
</view>
|
||||
<view class="h-100rpx"></view>
|
||||
</scroll-view>
|
||||
|
||||
<wd-popup
|
||||
v-model="myEvaluationShow"
|
||||
custom-style="border-radius:32rpx;"
|
||||
closable
|
||||
:safe-area-inset-bottom="true"
|
||||
>
|
||||
<wd-popup v-model="myEvaluationShow" custom-style="border-radius:32rpx;" closable :safe-area-inset-bottom="true">
|
||||
<view class="w-90vw h-400rpx flex-col-center gap-4 flex-wrap">
|
||||
<view class="text-color-theme text-lg">
|
||||
<text>我的评价</text>
|
||||
@@ -176,111 +140,106 @@
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
<wd-curtain
|
||||
v-model="curtainShow"
|
||||
<wd-curtain v-model="curtainShow"
|
||||
src="https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png"
|
||||
close-position="top-right"
|
||||
:width="300"
|
||||
close-on-click-modal
|
||||
show-menu-by-longpress
|
||||
/>
|
||||
close-position="top-right" :width="300" close-on-click-modal show-menu-by-longpress />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import UserAblum from './components/user-ablum.vue';
|
||||
import useAblum from '../profile/use-ablum';
|
||||
// @ts-ignore
|
||||
import sheep from '@/sheep';
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
// @ts-ignore
|
||||
import { fen2yuanSimple } from '@/sheep/hooks/useGoods';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import UserAblum from './components/user-ablum.vue';
|
||||
import useAblum from '../profile/use-ablum';
|
||||
// @ts-ignore
|
||||
import sheep from '@/sheep';
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
// @ts-ignore
|
||||
import { fen2yuanSimple } from '@/sheep/hooks/useGoods';
|
||||
|
||||
const { ablumList } = useAblum();
|
||||
const { ablumList } = useAblum();
|
||||
|
||||
// 统计信息
|
||||
const recentTotal = ref({
|
||||
memberRecentId: null,
|
||||
bizType: null,
|
||||
likeTotal: 0,
|
||||
likeItTotal: 0,
|
||||
likeMeTotal: 0,
|
||||
reportTotal: 0,
|
||||
shieldTotal: 0,
|
||||
collectTotal: 0,
|
||||
userLikeItTotal: 0,
|
||||
userLikeMeTotal: 0,
|
||||
// 统计信息
|
||||
const recentTotal = ref({
|
||||
memberRecentId: null,
|
||||
bizType: null,
|
||||
likeTotal: 0,
|
||||
likeItTotal: 0,
|
||||
likeMeTotal: 0,
|
||||
reportTotal: 0,
|
||||
shieldTotal: 0,
|
||||
collectTotal: 0,
|
||||
userLikeItTotal: 0,
|
||||
userLikeMeTotal: 0,
|
||||
});
|
||||
|
||||
// 我的评价数据
|
||||
const myEvaluation = reactive({
|
||||
scoreSc: 0,
|
||||
scoreNx: 0,
|
||||
scoreSk: 0,
|
||||
scoreYq: 0,
|
||||
avgScore: 0,
|
||||
evaluateCount: 0,
|
||||
});
|
||||
const myEvaluationShow = ref(false); // 我的评价弹窗
|
||||
const curtainShow = ref(false); // 关注公众号弹窗
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const userCity = computed(() => sheep.$store('user').userCity);
|
||||
const userWallet = computed(() => sheep.$store('user').userWallet);
|
||||
const userGenderImageSrc = computed(() => {
|
||||
const sex = userInfo.value.sex;
|
||||
if (sex === 1) return '/static/gender-man.png';
|
||||
if (sex === 2) return '/static/gender-woman.png';
|
||||
return '';
|
||||
});
|
||||
|
||||
onShow(async () => {
|
||||
const { data: totalData } = await RecentApi.recentTotal();
|
||||
recentTotal.value = totalData ?? {};
|
||||
});
|
||||
|
||||
// type: 0-我喜欢 1-喜欢我
|
||||
const goLike = (type: 0 | 1) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/profile/like?type=${type}`,
|
||||
});
|
||||
};
|
||||
|
||||
// 我的评价数据
|
||||
const myEvaluation = reactive({
|
||||
scoreSc: 0,
|
||||
scoreNx: 0,
|
||||
scoreSk: 0,
|
||||
scoreYq: 0,
|
||||
avgScore: 0,
|
||||
evaluateCount: 0,
|
||||
// 查看我的评价
|
||||
const lookMyEvaluation = async () => {
|
||||
const { data = null } = await RecentApi.myEvaluate();
|
||||
if (data) {
|
||||
Object.assign(myEvaluation, data);
|
||||
myEvaluationShow.value = true;
|
||||
return;
|
||||
}
|
||||
uni.showToast({ title: '查看失败', icon: 'none' });
|
||||
};
|
||||
|
||||
// 关注公众号
|
||||
const subOfficial = () => {
|
||||
curtainShow.value = true;
|
||||
};
|
||||
|
||||
// 问题反馈
|
||||
const goFeedback = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/feedback',
|
||||
});
|
||||
const myEvaluationShow = ref(false); // 我的评价弹窗
|
||||
const curtainShow = ref(false); // 关注公众号弹窗
|
||||
};
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const userCity = computed(() => sheep.$store('user').userCity);
|
||||
const userWallet = computed(() => sheep.$store('user').userWallet);
|
||||
const userGenderImageSrc = computed(() => {
|
||||
const sex = userInfo.value.sex;
|
||||
if (sex === 1) return '/static/gender-man.png';
|
||||
if (sex === 2) return '/static/gender-woman.png';
|
||||
return '';
|
||||
});
|
||||
|
||||
onShow(async () => {
|
||||
const { data: totalData } = await RecentApi.recentTotal();
|
||||
recentTotal.value = totalData ?? {};
|
||||
});
|
||||
|
||||
// type: 0-我喜欢 1-喜欢我
|
||||
const goLike = (type: 0 | 1) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/profile/like?type=${type}`,
|
||||
});
|
||||
};
|
||||
|
||||
// 查看我的评价
|
||||
const lookMyEvaluation = async () => {
|
||||
const { data = null } = await RecentApi.myEvaluate();
|
||||
if (data) {
|
||||
Object.assign(myEvaluation, data);
|
||||
myEvaluationShow.value = true;
|
||||
return;
|
||||
}
|
||||
uni.showToast({ title: '查看失败', icon: 'none' });
|
||||
};
|
||||
|
||||
// 关注公众号
|
||||
const subOfficial = () => {
|
||||
curtainShow.value = true;
|
||||
};
|
||||
|
||||
// 问题反馈
|
||||
const goFeedback = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/feedback',
|
||||
});
|
||||
};
|
||||
|
||||
// 菜单
|
||||
const MenuCellList = [
|
||||
{ title: '我的收益', value: '', icon: 'wallet', to: '/pages/wechat-tabbar/index' },
|
||||
{ title: '访客记录√', value: '', icon: 'browse', to: '/pages/profile/view-record' },
|
||||
{ title: '认证中心', value: '', icon: 'user', to: '/pages/profile/verify-status' },
|
||||
{ title: '我的动态√', value: '', icon: 'star', to: '/pages/profile/my-moment' },
|
||||
{ title: '我的评价√', value: '', icon: 'view-module', to: '', onClick: lookMyEvaluation },
|
||||
{ title: '问题反馈√', value: '', icon: 'backtop-rectangle', to: '', onClick: goFeedback },
|
||||
// { title: '客服助手', value: '', icon: 'service', to: '' },
|
||||
{ title: '关注公众号√', value: '获取最新消息', icon: 'qrcode', to: '', onClick: subOfficial },
|
||||
{ title: '设置√', value: '', icon: 'setting1', to: '/pages/profile/setting' },
|
||||
];
|
||||
// 菜单
|
||||
const MenuCellList = [
|
||||
{ title: '我的收益', value: '', icon: 'wallet', to: '/pages/wechat-tabbar/index' },
|
||||
{ title: '访客记录√', value: '', icon: 'browse', to: '/pages/profile/view-record' },
|
||||
{ title: '认证中心', value: '', icon: 'user', to: '/pages/profile/verify-status' },
|
||||
{ title: '我的动态√', value: '', icon: 'star', to: '/pages/profile/my-moment' },
|
||||
{ title: '我的评价√', value: '', icon: 'view-module', to: '', onClick: lookMyEvaluation },
|
||||
{ title: '问题反馈√', value: '', icon: 'backtop-rectangle', to: '', onClick: goFeedback },
|
||||
// { title: '客服助手', value: '', icon: 'service', to: '' },
|
||||
{ title: '关注公众号√', value: '获取最新消息', icon: 'qrcode', to: '', onClick: subOfficial },
|
||||
{ title: '设置√', value: '', icon: 'setting1', to: '/pages/profile/setting' },
|
||||
];
|
||||
</script>
|
||||
@@ -13,7 +13,7 @@
|
||||
<view class="flex items-center">
|
||||
<image :src="userInfo.avatar" class="size-50px rounded-full bg-#333 border border-amber border-solid"
|
||||
mode="aspectFill" />
|
||||
<view class="flex-1 ml-20rpx">
|
||||
<view v-if="isLogin" class="flex-1 ml-20rpx">
|
||||
<view class="mb-1 text-base">{{ userInfo.nickname }}</view>
|
||||
<view class="mb-2 text-xs text-#ffffff80 flex items-center">
|
||||
<text>ID: {{ userInfo.id }}</text>
|
||||
@@ -21,10 +21,15 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
<view v-if="isLogin" @tap="doLogout"
|
||||
class="text-color-theme-dark border-color-theme border-1px border-solid active_cl_bg-color-theme text-xs text-center px-2 py-8rpx rounded-full">
|
||||
退出登录
|
||||
</view>
|
||||
<view
|
||||
class="text-color-theme-dark border-color-theme border-1px border-solid active_cl_bg-color-theme text-xs text-center px-2 py-8rpx rounded-full"
|
||||
@tap="doLogin" v-else>
|
||||
立即登录
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提现相关 -->
|
||||
<view class="mx-20rpx mt-30rpx bg-color-dark rounded-12rpx px-6 py-4">
|
||||
@@ -36,7 +41,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-center items-center mt-30rpx">
|
||||
<text class="bg-color-theme-dark active_cl_bg-color-theme text-base text-center px-80rpx py-12rpx rounded-full">
|
||||
<text class="bg-color-theme-dark active_cl_bg-color-theme text-base text-center px-80rpx py-12rpx rounded-full"
|
||||
@tap="doTx">
|
||||
立即提现
|
||||
</text>
|
||||
</view>
|
||||
@@ -64,7 +70,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 海报 -->
|
||||
<view class="mx-20rpx mt-30rpx bg-color-dark rounded-12rpx px-6 py-4">
|
||||
<view v-if="isLogin" class="mx-20rpx mt-30rpx bg-color-dark rounded-12rpx px-6 py-4">
|
||||
<view class="text-lg">我的邀请海报</view>
|
||||
<image class="mt-30rpx" :src="state.posterPic" mode="widthFix" />
|
||||
<view class="mt-30rpx flex justify-between items-center text-xs">
|
||||
@@ -82,6 +88,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="h-30rpx" />
|
||||
<wd-message-box />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
@@ -93,9 +100,18 @@ import sheep from '@/sheep';
|
||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||
import TradeConfigApi from '@/sheep/api/trade/config.js';
|
||||
import SocialApi from '@/sheep/api/member/social';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const message = useMessage();
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user')?.userInfo ?? null);
|
||||
const isLogin = computed(() => sheep.$store('user').isLogin && state.loginInfoStorage != null);
|
||||
const userGenderImageSrc = computed(() => {
|
||||
const sex = userInfo.value.sex;
|
||||
if (sex === 1) return '/static/gender-man.png';
|
||||
if (sex === 2) return '/static/gender-woman.png';
|
||||
return '';
|
||||
});
|
||||
|
||||
const data = {
|
||||
menuTab: [
|
||||
@@ -155,12 +171,16 @@ const state = reactive({
|
||||
summary: {},
|
||||
posterPic: '',
|
||||
posterUrl: '',
|
||||
loginInfoStorage: "",
|
||||
});
|
||||
|
||||
onShow(async () => {
|
||||
await getTradeConfig()
|
||||
await getBrokerageUserSummary()
|
||||
getMiniProgramPoster()
|
||||
state.loginInfoStorage = uni.getStorageSync('loginInfo') ?? null
|
||||
if (isLogin.value) {
|
||||
await getTradeConfig()
|
||||
await getBrokerageUserSummary()
|
||||
getMiniProgramPoster()
|
||||
}
|
||||
});
|
||||
|
||||
// 获取分销配置
|
||||
@@ -248,7 +268,53 @@ const savePoster = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const doLogin = () => {
|
||||
sheep.$store('user').logout();
|
||||
uni.reLaunch({ url: '/pages/login/login' });
|
||||
}
|
||||
|
||||
const doLogout = () => {
|
||||
message
|
||||
.confirm({
|
||||
msg: '',
|
||||
title: '确定退出登录吗?',
|
||||
})
|
||||
.then(() => {
|
||||
sheep.$store('user').logout();
|
||||
uni.reLaunch({ url: '/pages/login/login' });
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
const doTx = () => {
|
||||
if (!isLogin.value) {
|
||||
authDialog()
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const authDialog = () => {
|
||||
message
|
||||
.confirm({
|
||||
msg: '',
|
||||
title: '该功能需要登录,请先登录',
|
||||
confirmButtonText: '请先登录',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
.then(() => {
|
||||
sheep.$store('user').logout();
|
||||
uni.reLaunch({ url: '/pages/login/login' });
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
const doTxItem = (item) => {
|
||||
if (!isLogin.value) {
|
||||
authDialog()
|
||||
return;
|
||||
}
|
||||
if (item.path) {
|
||||
uni.navigateTo({
|
||||
url: item.path,
|
||||
@@ -257,6 +323,10 @@ const doTxItem = (item) => {
|
||||
};
|
||||
|
||||
const doItem = (item) => {
|
||||
if (!isLogin.value) {
|
||||
authDialog()
|
||||
return;
|
||||
}
|
||||
if (item.path) {
|
||||
uni.navigateTo({
|
||||
url: item.path,
|
||||
|
||||
@@ -1,8 +1,75 @@
|
||||
<template>
|
||||
<view>
|
||||
我的
|
||||
</view>
|
||||
<wd-config-provider theme="dark">
|
||||
<wd-navbar title="我的" safeAreaInsetTop :bordered="false" />
|
||||
<scroll-view class="h-[calc(100vh-144rpx)]" scroll-y>
|
||||
<view class="mx-20rpx mt-30rpx bg-color-dark rounded-12rpx flex justify-between items-center px-6 py-4">
|
||||
<view class="flex items-center">
|
||||
<image :src="userInfo.avatar"
|
||||
class="size-50px rounded-full bg-#333 border border-amber border-solid" mode="aspectFill" />
|
||||
<view v-if="isLogin" class="flex-1 ml-20rpx">
|
||||
<view class="mb-1 text-base">{{ userInfo.nickname }}</view>
|
||||
<view class="mb-2 text-xs text-#ffffff80 flex items-center">
|
||||
<text>ID: {{ userInfo.id }}</text>
|
||||
<image class="size-24rpx ml-4" :src="userGenderImageSrc" mode="scaleToFill" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="text-color-theme-dark border-color-theme border-1px border-solid active_cl_bg-color-theme text-xs text-center px-2 py-8rpx rounded-full"
|
||||
@tap="doLogin">
|
||||
立即登录
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="isLogin" @tap="doLogout" class="flex justify-center items-center mx-20rpx mt-60rpx">
|
||||
<text
|
||||
class="bg-color-theme-dark active_cl_bg-color-theme text-base text-center w-full px-80rpx py-12rpx rounded-full">
|
||||
退出登录
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<wd-message-box />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
// @ts-ignore
|
||||
import sheep from '@/sheep';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
|
||||
const message = useMessage();
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user')?.userInfo ?? null);
|
||||
const isLogin = computed(() => userInfo.value !== null && state.loginInfoStorage);
|
||||
const userGenderImageSrc = computed(() => {
|
||||
const sex = userInfo.value.sex;
|
||||
if (sex === 1) return '/static/gender-man.png';
|
||||
if (sex === 2) return '/static/gender-woman.png';
|
||||
return '';
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
loginInfoStorage: "",
|
||||
})
|
||||
|
||||
onShow(async () => {
|
||||
state.loginInfoStorage = uni.getStorageSync('loginInfo') ?? null
|
||||
});
|
||||
|
||||
const doLogout = () => {
|
||||
message
|
||||
.confirm({
|
||||
msg: '',
|
||||
title: '确定退出登录吗?',
|
||||
})
|
||||
.then(() => {
|
||||
sheep.$store('user').logout();
|
||||
uni.reLaunch({ url: '/pages/login/login' });
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error:", error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -71,6 +71,14 @@ const SocialApi = {
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获取微信小程短链
|
||||
getWxaQrcode: async (params) => {
|
||||
return await request({
|
||||
url: '/member/social-user/wxa-url-scheme',
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default SocialApi;
|
||||
@@ -151,8 +151,8 @@ const adaptTenant = async () => {
|
||||
// #ifdef MP
|
||||
const appId = uni.getAccountInfoSync()?.miniProgram?.appId;
|
||||
if (appId) {
|
||||
const { data } = await getTenantByWebsite(appId);
|
||||
newTenantId = data?.id;
|
||||
// const { data } = await getTenantByWebsite(appId);
|
||||
// newTenantId = data?.id;
|
||||
}
|
||||
// #endif
|
||||
|
||||
@@ -176,7 +176,7 @@ const adaptTenant = async () => {
|
||||
const adaptTemplate = async (appTemplate, templateId) => {
|
||||
const { data: diyTemplate } = templateId
|
||||
? // 查询指定模板,一般是预览时使用
|
||||
await DiyApi.getDiyTemplate(templateId)
|
||||
await DiyApi.getDiyTemplate(templateId)
|
||||
: await DiyApi.getUsedDiyTemplate();
|
||||
// 模板不存在
|
||||
if (!diyTemplate) {
|
||||
|
||||
@@ -127,6 +127,8 @@ const user = defineStore({
|
||||
this.userInfo = clone(defaultUserInfo);
|
||||
this.userWallet = clone(defaultUserWallet);
|
||||
this.numData = cloneDeep(defaultNumData);
|
||||
// 清空聊天相关
|
||||
uni.removeStorageSync('loginInfo');
|
||||
// 清空购物车的缓存
|
||||
cart().emptyList();
|
||||
},
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
// @ts-nocheck
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import SocialApi from '@/sheep/api/member/social';
|
||||
|
||||
const targetAppId = 'wx2b4e4d3feff8267f';
|
||||
|
||||
const paramsToQuery = (params: Record<string, any>) => {
|
||||
if (isEmpty(params)) {
|
||||
return '';
|
||||
}
|
||||
let query = [];
|
||||
for (let key in params) {
|
||||
query.push(key + '=' + params[key]);
|
||||
}
|
||||
return query.join('&');
|
||||
}
|
||||
|
||||
export const jumpToWechatMiniProgram = (
|
||||
export const jumpToWechatMiniProgram = async (
|
||||
action: 'recharge' | 'openVip',
|
||||
params: Record<string, any>,
|
||||
) => {
|
||||
@@ -25,27 +15,14 @@ export const jumpToWechatMiniProgram = (
|
||||
if (action === 'openVip') {
|
||||
path = 'pages/profile/apply-vip';
|
||||
}
|
||||
console.log("weixinShare:", weixinShare)
|
||||
plus.share.getServices((data) => {
|
||||
let sweixin = null;
|
||||
data.forEach(item => {
|
||||
if (item.id === "weixin") {
|
||||
sweixin = item
|
||||
}
|
||||
})
|
||||
console.log("sweixin:", sweixin)
|
||||
if (!sweixin) {
|
||||
uni.showToast({
|
||||
title: "请安装微信",
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
sweixin.launchMiniProgram({
|
||||
id: targetAppId,
|
||||
try {
|
||||
// 获取小程序短链
|
||||
const { code, data } = await SocialApi.getWxaQrcode({
|
||||
path: path,
|
||||
// 可取值:0-正式版; 1-测试版; 2-体验版。默认值为0。
|
||||
type: 1,
|
||||
});
|
||||
})
|
||||
json: JSON.stringify(params)
|
||||
})
|
||||
console.log("|获取小程序短链|成功code:", code, "data:", data);
|
||||
} catch (error) {
|
||||
console.log("|获取小程序短链|意外的错误error:", error);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user