Feat:寻看点和抽奖

This commit is contained in:
lifizer
2024-02-06 12:42:46 +08:00
parent c88b6aa8a8
commit f3115fe7c8
73 changed files with 5324 additions and 6887 deletions
+107 -134
View File
@@ -1,11 +1,11 @@
<template>
<view class="user-personalData">
<view class="top-box" :style="{'backgroundImage':`url(${webUrl}/20220925102928757633.png)`}">
<view class="top-box" :style="{'backgroundImage':`url(${webUrl}/20240109234153916906.png)`}">
<view class="flex ai-center">
<image-cropper :src="tempFilePath" @confirm="confirm" @cancel="cancel"></image-cropper>
<view style="position: relative" @tap="chooseImage">
<image class="cover" :src="avatar"/>
<image class="btn-change" :src="webUrl+'/20220925111121285647.png'"/>
<view class="btn-change flex jc-center ai-center">更换头像</view>
</view>
<view>
<view class="name">{{ userInfo.nickname }}</view>
@@ -62,56 +62,19 @@
<button class="btn-save" @click="submit">保存修改</button>
<!-- <view class="list">-->
<!-- <view class="item acea-row row-between-wrapper">-->
<!-- <view>昵称</view>-->
<!-- <view class="input">-->
<!-- <input type="text" v-model="userInfo.nickname"/>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="item acea-row row-between-wrapper">-->
<!-- <view>ID号</view>-->
<!-- <view class="input acea-row row-between-wrapper">-->
<!-- <input type="text" :value="userInfo.uid" disabled class="id"/>-->
<!-- <text class="iconfont icon-suozi"></text>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="item acea-row row-between-wrapper" @click="bindPhone">-->
<!-- <view>手机号</view>-->
<!-- <view class="input acea-row row-between-wrapper">-->
<!-- <input type="text" disabled v-if="userInfo.phone" v-model="userInfo.phone" class="id"/>-->
<!-- <input type="text" v-else value="未绑定" disabled class="id"/>-->
<!-- <text class="iconfont icon-jiantou"></text>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="item acea-row row-between-wrapper" @click="payPwdClick">-->
<!-- <view>支付密码</view>-->
<!-- <view class="input acea-row row-right">-->
<!-- <text class="iconfont icon-jiantou"></text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="modifyBnt bg-color-lightred" @click="submit">保存修改</view>-->
<view
class="logOut cart-color acea-row row-center-wrapper"
@click="logout"
v-if="$deviceType=='app'"
>退出登录
</view>
<!-- <view-->
<!-- class="logOut cart-color acea-row row-center-wrapper"-->
<!-- @click="logout"-->
<!-- v-if="$deviceType=='app'"-->
<!-- >退出登录-->
<!-- </view>-->
</view>
</template>
<script>
import {mapGetters} from "vuex";
import {trim, isWeixin, chooseImage, uploadImage} from "@/utils";
import {
postUserEdit,
getLogout,
switchH5Login
} from "@/api/user";
import cookie from "@/utils/store/cookie";
import store from "@//store";
import dayjs from "dayjs";
import {isWeixin, trim, uploadImage} from "@/utils";
import {postUserEdit} from "@/api/user";
import ImageCropper from "@/pkg_user/components/invinbg-image-cropper/invinbg-image-cropper.vue";
export default {
@@ -173,44 +136,44 @@ export default {
this.$yrouter.push("/pkg_user/views/bindPhone");
}
},
switchAccounts: function (index) {
let that = this;
this.userIndex = index;
let userInfo = this.switchUserInfo[this.userIndex];
if (this.switchUserInfo.length <= 1) return true;
if (userInfo === undefined) {
uni.showToast({
title: "切换的账号不存在",
icon: "none",
duration: 2000
});
return;
}
if (userInfo.user_type === "h5") {
switchH5Login()
.then(({data}) => {
uni.hideLoading();
const expires_time = dayjs(data.expires_time);
store.commit("login", data.token, expires_time);
that.$emit("changeswitch", false);
location.reload();
})
.catch(err => {
uni.hideLoading();
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
} else {
cookie.set("loginType", "wechat", 60);
uni.hideLoading();
this.$store.commit("logout");
this.$emit("changeswitch", false);
}
},
// switchAccounts: function (index) {
// let that = this;
// this.userIndex = index;
// let userInfo = this.switchUserInfo[this.userIndex];
// if (this.switchUserInfo.length <= 1) return true;
// if (userInfo === undefined) {
// uni.showToast({
// title: "切换的账号不存在",
// icon: "none",
// duration: 2000
// });
// return;
// }
// if (userInfo.user_type === "h5") {
// switchH5Login()
// .then(({data}) => {
// uni.hideLoading();
// const expires_time = dayjs(data.expires_time);
// store.commit("login", data.token, expires_time);
// that.$emit("changeswitch", false);
// location.reload();
// })
// .catch(err => {
// uni.hideLoading();
// uni.showToast({
// title:
// err.msg || err.response.data.msg || err.response.data.message,
// icon: "none",
// duration: 2000
// });
// });
// } else {
// cookie.set("loginType", "wechat", 60);
// uni.hideLoading();
// this.$store.commit("logout");
// this.$emit("changeswitch", false);
// }
// },
chooseImage() {
uni.chooseImage({
count: 1, //默认9
@@ -250,36 +213,34 @@ export default {
}
);
},
logout: function () {
uni.showModal({
title: "提示",
content: "确认退出登录?",
success: function (res) {
if (res.confirm) {
getLogout()
.then(res => {
this.$store.commit("logout");
this.$yrouter.replace({
path: "/pages/user/Login/index",
query: {}
});
})
.catch(err => {
});
} else if (res.cancel) {
// console.log("用户点击取消");
}
}
});
}
// logout: function () {
// uni.showModal({
// title: "提示",
// content: "确认退出登录?",
// success: function (res) {
// if (res.confirm) {
// getLogout()
// .then(res => {
// this.$store.commit("logout");
// this.$yrouter.replace({
// path: "/pages/user/Login/index",
// query: {}
// });
// })
// .catch(() => {
// })
// }
// }
// });
// }
}
};
}
</script>
<style scoped lang="less">
.user-personalData {
min-height: 100vh;
background: #F9F9F9;
background: #F6F6F6;
view {
box-sizing: border-box;
@@ -287,42 +248,49 @@ export default {
.top-box {
width: 100vw;
height: 332.5rpx;
padding: 94rpx 0 0 104rpx;
background-size: 750rpx 332.5rpx;
height: 396.5rpx;
padding: 86rpx 0 0 76rpx;
background-size: 750rpx 396.5rpx;
color: #FFFFFF;
.cover {
width: 136rpx;
height: 136rpx;
width: 112rpx;
height: 112rpx;
border-radius: 50%;
margin-right: 42rpx;
margin-right: 44rpx;
}
.btn-change {
position: absolute;
top: 100rpx;
left: 13rpx;
left: 0;
top: 98rpx;
width: 110rpx;
height: 44rpx;
height: 36rpx;
border-radius: 20rpx;
background: #FFFFFF;
color: #333333;
font-size: 22rpx;
}
.name {
font-size: 32rpx;
line-height: 48rpx;
font-size: 36rpx;
line-height: 52rpx;
font-weight: bold;
}
.phone {
margin-top: 22rpx;
margin-top: 18rpx;
font-size: 28rpx;
line-height: 40rpx;
}
}
.cell-box {
margin: 54rpx 32rpx;
padding: 0 25rpx;
width: 686rpx;
height: 406rpx;
margin: -130rpx 32rpx 0;
padding: 0 40rpx 20rpx;
box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.16);
border-radius: 12rpx;
background: #FFFFFF;
@@ -331,36 +299,41 @@ export default {
}
.cell {
padding: 32rpx 0 20rpx;
border-bottom: 1rpx solid #E8E9E9;
font-size: 28rpx;
line-height: 40rpx;
padding: 24rpx 0;
border-bottom: 1rpx solid #ECECEE;
.title {
width: 112rpx;
margin-right: 40rpx;
width: 160rpx;
color: #333333;
font-weight: bold;
font-size: 32rpx;
line-height: 48rpx;
}
.value {
color: #999999;
font-size: 32rpx;
line-height: 48rpx;
}
.icon {
image {
width: 26rpx;
height: 26rpx;
width: 32rpx;
height: 32rpx;
}
}
}
}
.btn-save {
margin: 0 32rpx;
background: #FE5261;
position: fixed;
left: 32rpx;
bottom: 160rpx;
width: 686rpx;
border-radius: 40rpx;
background: #C41617;
color: #FFFFFF;
font-size: 32rpx;
font-size: 36rpx;
}
}
</style>