优化样式

This commit is contained in:
dengjie
2023-01-31 00:14:42 +08:00
parent 7502bab1c0
commit 6445aa4783
10 changed files with 113 additions and 227 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="my_avatar"> <view class="my_avatar">
<view style="border-radius: 50rpx;"> <view style="border-radius: 50rpx;">
<u-avatar :src="avatar" size="100rpx" shape="circle"></u-avatar> <u-avatar :src="avatar" size="100rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view> </view>
<view style="margin-top: 10rpx;margin-bottom: 4rpx;"> <view style="margin-top: 10rpx;margin-bottom: 4rpx;">
<u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx"> <u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx">
@@ -10,15 +10,21 @@
</u--image> </u--image>
</view> </view>
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<text>{{nickname}}</text> <text @click="changeAvatar()">{{nickname}}</text>
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx" <u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
@click="changeAvatar()"> @click="changeAvatar()">
</u--image> </u--image>
</view> </view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
name: "myAvatar", name: "myAvatar",
props: { props: {
@@ -27,6 +33,9 @@
default: '' default: ''
} }
}, },
components: {
login
},
data() { data() {
return { return {
member: false, member: false,
@@ -35,6 +44,7 @@
nickname: '用户', nickname: '用户',
normal: '/static/my/wo_icon_pthy.png', normal: '/static/my/wo_icon_pthy.png',
VIP: '/static/my/wo_icon_vip.png', VIP: '/static/my/wo_icon_vip.png',
isLoad: true,
}; };
}, },
created() { created() {
@@ -42,6 +52,14 @@
this.showEdit = false this.showEdit = false
} }
this.getUser() this.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
}, },
options: { options: {
styleIsolation: 'shared', // 解除样式隔离 styleIsolation: 'shared', // 解除样式隔离
@@ -56,12 +74,33 @@
//获取头像昵称和普通会员和VIP会员 //获取头像昵称和普通会员和VIP会员
getUser() { getUser() {
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
console.log('个人信息==', res.data.data); console.log('个人信息==', res.data);
if (res.data.msg == "登录超时,请重新登录") {
this.isLoad = false
}
var data = res.data.data var data = res.data.data
this.avatar = data.avatar this.avatar = data.avatar
this.nickname = data.nickname this.nickname = data.nickname
this.member = data.member this.member = data.member
}).finally(_ => {}) }).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.$refs.myavatar.getUser()
},
failToLoad() {
// uni.navigateBack({
// url: '/pages/my/my'
// })
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -2,7 +2,7 @@
<view> <view>
<view class="products_box"> <view class="products_box">
<u-grid :border="false" col="2"> <u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index"> <u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)">
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true"> <u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image> </u-image>
<view class="bgContent"> <view class="bgContent">
@@ -29,16 +29,12 @@
</view> </view>
</view> </view>
</view> </view>
<u-button v-if="type==1" type="success" text="取消收藏" color="#0EBB5B" @click="cancelCollect(item)"> <u-button v-if="type==1" type="success" text="取消收藏" color="#0EBB5B" @click="cancelCollect(item)">
</u-button> </u-button>
<u-button v-if="type==2" type="success" text="移除" color="#0EBB5B" @click="deleteProduct(item)"> <u-button v-if="type==2" type="success" text="移除" color="#0EBB5B" @click="deleteProduct(item)">
</u-button> </u-button>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
<!-- <u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay="false" @confirm="confirm"
@cancel="cancel">
</u-modal> -->
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;" <view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="type==1&&productList.length==0"> v-if="type==1&&productList.length==0">
暂无更多收藏记录</view> 暂无更多收藏记录</view>
@@ -133,6 +129,12 @@
} }
}) })
}, },
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
})
}
} }
} }
</script> </script>

View File

@@ -6,40 +6,20 @@
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm"> <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="content"></rich-text>
</u-modal> </u-modal>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
name: '', name: '',
phone: '', phone: '',
showM: false, showM: false,
content: `您的申请已提交<br> content: `您的申请已提交<br>
请静待人工审核`, 请静待人工审核`
isLoad: true,
} }
}, },
onLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: { methods: {
handleSureClick() { handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name let name = this.$refs.nameAndphone.model.userInfo.name
@@ -63,22 +43,7 @@
// uni.switchTab({ // uni.switchTab({
// url: '/pages/my/my' // url: '/pages/my/my'
// }) // })
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
} }
this.isLoad = true
},
failToLoad() {
this.$toast.warn('登录失败请重试')
}
} }
} }
</script> </script>

View File

@@ -1,52 +1,16 @@
<template> <template>
<view> <view>
<productsBtn :type="2" ref="browseHistory"></productsBtn> <productsBtn :type="2" ref="browseHistory"></productsBtn>
<!-- <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view> -->
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
type: '', type: ''
isLoad: true,
} }
}, },
onLoad() { methods: {}
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: {
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.$refs.browseHistory.getHistoryOrCollection()
},
failToLoad() {
this.$toast.warn('登录失败请重试')
}
}
} }
</script> </script>

View File

@@ -14,11 +14,6 @@
<view style="height: 230rpx;"></view> <view style="height: 230rpx;"></view>
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSubmit()"></u-button> <u-button type="success" text="确定" color="#0EBB5B" @click="handleSubmit()"></u-button>
</view> </view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view> </view>
</template> </template>
@@ -26,11 +21,7 @@
import { import {
apiService apiService
} from '../../service/request' } from '../../service/request'
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
avatar: '', avatar: '',
@@ -39,26 +30,17 @@
userInfo: { userInfo: {
name: '' name: ''
}, },
}, }
isLoad: true,
} }
}, },
onLoad() { onLoad() {
this.getUser() this.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
}, },
methods: { methods: {
//获取头像昵称 //获取头像昵称
getUser() { getUser() {
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
// console.log('头像昵称', res.data); console.log('头像昵称', res.data);
var data = res.data.data var data = res.data.data
this.avatar = data.avatar this.avatar = data.avatar
this.model.userInfo.name = data.nickname this.model.userInfo.name = data.nickname
@@ -114,23 +96,6 @@
url: '/pages/my/my' url: '/pages/my/my'
}) })
}).finally(_ => {}) }).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
failToLoad() {
// uni.navigateBack({
// url: '/pages/my/my'
// })
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -13,26 +13,16 @@
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm"> <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="content"></rich-text>
</u-modal> </u-modal>
<!-- <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view> -->
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
name: '', name: '',
phone: '', phone: '',
showM: false, showM: false,
isLoad: true,
//会员中心的用户名旁边不显示edit图标 //会员中心的用户名旁边不显示edit图标
show: false, show: false,
content: `请保持手机畅通<br> content: `请保持手机畅通<br>
@@ -40,16 +30,6 @@
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置' commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
} }
}, },
onLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: { methods: {
// 联系客服模态框 // 联系客服模态框
handleSureClick() { handleSureClick() {
@@ -75,20 +55,6 @@
// uni.switchTab({ // uni.switchTab({
// url: '/pages/my/my' // url: '/pages/my/my'
// }) // })
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
failToLoad() {
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -1,51 +1,17 @@
<template> <template>
<view> <view>
<productsBtn :type="1"></productsBtn> <productsBtn :type="1"></productsBtn>
<!-- <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view> -->
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
type: '', type: '',
isLoad: true, isLoad: true,
} }
}, },
onLoad() { methods: {}
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: {
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
failToLoad() {
this.$toast.warn('登录失败请重试')
}
}
} }
</script> </script>

View File

@@ -47,11 +47,6 @@
</view> </view>
</view> </view>
</view> </view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;" <view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="needsList.length==0&&tabCurrent == 0"> v-if="needsList.length==0&&tabCurrent == 0">
暂无更多记录</view> 暂无更多记录</view>
@@ -65,14 +60,9 @@
import { import {
dateFormatXwDetail dateFormatXwDetail
} from '../../utills/date.js' } from '../../utills/date.js'
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
isLoad: true,
// id: '', // id: '',
// showM: false, // showM: false,
content: '您确定删除吗?', content: '您确定删除吗?',
@@ -89,15 +79,6 @@
}, },
onLoad() { onLoad() {
this.getIdeasAndNeeds() this.getIdeasAndNeeds()
console.log(uni.getStorageSync('loginToken'));
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
}, },
methods: { methods: {
//获取创意发布 //获取创意发布
@@ -162,21 +143,6 @@
} }
} }
}) })
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.getIdeasAndNeeds()
},
failToLoad() {
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -59,6 +59,12 @@
this.$apiServe.getProductList(data).then(res => { this.$apiServe.getProductList(data).then(res => {
this.productList = res.data.data this.productList = res.data.data
}).finally(_ => {}) }).finally(_ => {})
},
//点击图片跳转到详情页
toDetailPage(item) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id
})
} }
} }
} }

View File

@@ -4,7 +4,7 @@
<u-navbar :autoBack="false" title="我的"></u-navbar> <u-navbar :autoBack="false" title="我的"></u-navbar>
<u--image src="/static/my/wo_icon_bj1.png" width="750rpx" height="349rpx"> <u--image src="/static/my/wo_icon_bj1.png" width="750rpx" height="349rpx">
</u--image> </u--image>
<myAvatar></myAvatar> <myAvatar ref="myavatar"></myAvatar>
<view class="table"> <view class="table">
<u-cell-group> <u-cell-group>
<u-cell size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true" value="未绑定公司" <u-cell size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true" value="未绑定公司"
@@ -30,18 +30,47 @@
</view> </view>
</u-modal> </u-modal>
</view> </view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view> </view>
</template> </template>
<script> <script>
import loginVue from './login/login.vue' import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
showM: false, showM: false,
phone: '138 1222 222', phone: '138 1222 222',
isLoad: true,
} }
}, },
onTabItemTap() {
this.$refs.myavatar.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
onLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: { methods: {
//跳转到绑定公司页面 //跳转到绑定公司页面
bindCompany() { bindCompany() {
@@ -95,6 +124,24 @@
}, },
close() { close() {
this.showM = false this.showM = false
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.$refs.myavatar.getUser()
},
failToLoad() {
// uni.navigateBack({
// url: '/pages/my/my'
// })
this.$toast.warn('登录失败请重试')
} }
} }
} }