Browse Source

样式优化

h5_css
蟑螂恶霸 3 years ago
parent
commit
1e0898c3b9
  1. 7
      components/tabbar/tabbar.vue
  2. 2
      pages/my/my.vue
  3. 12
      static/base_css.css
  4. 516
      subpkg/address/address.vue
  5. 45
      subpkg/complete/complete.vue
  6. 11
      subpkg/feedback/feedback.vue
  7. 15
      subpkg/knowledgeInfo/knowledgeInfo.vue
  8. 2
      subpkg/list/list.vue
  9. 4
      subpkg/practice/practice.vue
  10. 3
      subpkg/privacy/privacy.vue
  11. 2
      subpkg/review/review.vue
  12. 12
      subpkg/role/role.vue

7
components/tabbar/tabbar.vue

@ -83,13 +83,16 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.tab_bar { .tab_bar {
padding: 10rpx 0 50rpx 0;
width: 100vw; width: 100vw;
height: 90rpx; height: 90rpx;
position: fixed; position: fixed;
bottom: 30rpx; bottom: 0;
border-top: 1px solid #ddd;
background-color: #fff;
/* 模糊大小就是靠的blur这个函数中的数值大小 */ /* 模糊大小就是靠的blur这个函数中的数值大小 */
// backdrop-filter: blur(10px); // backdrop-filter: blur(10px);
border-radius: 60rpx; //border-radius: 60rpx;
.tabbarBox { .tabbarBox {
display: flex; display: flex;

2
pages/my/my.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="stabar"></view>
<view class="mainwrap2"> <view class="mainwrap">
<view class="perinfo"> <span class="type-name"><img :src="avatarUrl"></img></span> <view class="perinfo"> <span class="type-name"><img :src="avatarUrl"></img></span>
<view class="dycd"> <span class="myname">{{name}}</span> <view class="dycd"> <span class="myname">{{name}}</span>
<view class="myitem"> <span @click="showMedal()">勋章:{{medalNum}}<i :style="{'background-color':active == 0 ?'red':'none'}"></i></span> <span>挑战历史:{{challengeNum}}</span> </view> <view class="myitem"> <span @click="showMedal()">勋章:{{medalNum}}<i :style="{'background-color':active == 0 ?'red':'none'}"></i></span> <span>挑战历史:{{challengeNum}}</span> </view>

12
static/base_css.css

@ -58,9 +58,9 @@ img {
.mainwrap { .mainwrap {
margin-top: 90rpx; position: relative;
padding-bottom: 5%; top: 90rpx;
height: calc(100% - 260rpx); height: calc(100% - 250rpx);
width: 100%; width: 100%;
background-image: linear-gradient(to bottom, #bac6fc, transparent 50%); background-image: linear-gradient(to bottom, #bac6fc, transparent 50%);
box-sizing: content-box; box-sizing: content-box;
@ -71,7 +71,7 @@ img {
position: relative; position: relative;
top: 1%; top: 1%;
width: 100%; width: 100%;
height: 17.5%; height: 16.5%;
text-align: center; text-align: center;
} }
@ -85,7 +85,7 @@ img {
top: -3.5%; top: -3.5%;
z-index: 1; z-index: 1;
margin: 0 auto; margin: 0 auto;
height: 65%; height: 63%;
width: 94%; width: 94%;
box-sizing: content-box; box-sizing: content-box;
border-radius: 20rpx; border-radius: 20rpx;
@ -267,7 +267,7 @@ h3.contit span {
position: relative; position: relative;
top: 90rpx; top: 90rpx;
width: 100%; width: 100%;
height: calc(100% - 200rpx); height: calc(100% - 180rpx);
background-image: linear-gradient(to bottom, #bac6fc, transparent 40%); background-image: linear-gradient(to bottom, #bac6fc, transparent 40%);
box-sizing: content-box; box-sizing: content-box;
overflow: hidden; overflow: hidden;

516
subpkg/address/address.vue

@ -1,245 +1,289 @@
<template> <template>
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="stabar"></view>
<view class="secbar"><label class="back" @click="back()"></label> <view class="secbar"><label class="back" @click="back()"></label>
<view class="title">联系地址</view> <view class="title">联系地址</view>
</view> </view>
<view class="cart-container"> <view class="mainwrap2">
<!-- 选择收货地址的盒子 --> <view class="subwrap">
<view class="address-choose-box">
<button type="primary" size="mini" class="btnChooseAddress" @click="chooseAddress">新增地址+</button>
</view> <!-- 底部的边框线 -->
<image src="/static/cart_border@2x.png" class="address-border"></image>
<!-- 底部的边框线 -->
<image src="/static/cart_border@2x.png" class="address-border"></image> <!-- 循环渲染地址信息 -->
<!-- 循环渲染地址信息 --> <view>
<uni-swipe-action>
<view> <block v-for="(item, i) in addressList" :key="i">
<uni-swipe-action> <uni-swipe-action-item :right-options="options" @click="swipeItemClickHandler(item)">
<block v-for="(item, i) in addressList" :key="i"> <view class="address-info-box">
<uni-swipe-action-item :right-options="options" @click="swipeItemClickHandler(item)"> <view class="row1">
<view class="address-info-box"> <view class="row1-left">
<view class="row1"> <view class="username">收货人:{{item.name}}</view>
<view class="row1-left"> </view>
<view class="username">收货人:{{item.name}}</view> <view class="row1-right">
</view> <view class="phone">电话:{{item.mobile}}</view>
<view class="row1-right"> <uni-icons type="arrowright" size="16"></uni-icons>
<view class="phone">电话:{{item.mobile}}</view> </view>
<uni-icons type="arrowright" size="16"></uni-icons> </view>
</view> <view class="row2">
</view> <view class="row2-left">收货地址:</view>
<view class="row2"> <view class="row2-right">{{item.address}}</view>
<view class="row2-left">收货地址:</view> </view>
<view class="row2-right">{{item.address}}</view> </view>
</view> </uni-swipe-action-item>
</view> </block>
</uni-swipe-action-item> </uni-swipe-action>
</block> </view>
</uni-swipe-action> </view>
</view>
<!-- 选择收货地址的盒子 -->
<view class="address-choose-box">
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">批量刪除</button>
<button type="primary" size="mini" class="uni-button" @click="chooseAddress">新增地址</button>
</view>
</view> </view>
</view>
</view>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapGetters } from 'vuex' import {
import addressVue from './address.vue'; mapState,
mapMutations,
export default { mapGetters
data() { } from 'vuex'
return { import addressVue from './address.vue';
options: [{
text: '删除', export default {
style: { data() {
backgroundColor: '#C00000' return {
} options: [{
}], text: '删除',
addressList:[] style: {
}; backgroundColor: '#C00000'
}, }
onLoad() { }],
this.initAddress(); addressList: []
}, };
methods: { },
...mapMutations('m_user', ['updateAddress']), onLoad() {
async initAddress(){ this.initAddress();
const { },
data: res methods: {
} = await uni.$http.post('/small/project/address/listAll',{userId:this.userId}) ...mapMutations('m_user', ['updateAddress']),
if (!res.success) return uni.$showMsg() async initAddress() {
this.addressList = res.data; const {
}, data: res
async chooseAddress() { } = await uni.$http.post('/small/project/address/listAll', {
const [err, succ] = await uni.chooseAddress().catch(err => err) userId: this.userId
if (err === null && succ.errMsg === 'chooseAddress:ok') { })
this.updateAddress(succ) if (!res.success) return uni.$showMsg()
this.addressList = res.data;
const addressObj = { },
userId: this.userId, async chooseAddress() {
name: succ.userName, const [err, succ] = await uni.chooseAddress().catch(err => err)
mobile: succ.telNumber, if (err === null && succ.errMsg === 'chooseAddress:ok') {
address: succ.provinceName + succ.cityName + succ.countyName + succ.detailInfo this.updateAddress(succ)
}
this.addressList.push(addressObj) const addressObj = {
userId: this.userId,
const { name: succ.userName,
data: res mobile: succ.telNumber,
} = await uni.$http.post('/small/project/address/add',addressObj) address: succ.provinceName + succ.cityName + succ.countyName + succ.detailInfo
if (!res.success) return uni.$showMsg() }
this.initAddress(); this.addressList.push(addressObj)
}
const {
if (err && (err.errMsg === 'chooseAddress:fail auth deny' || err.errMsg === 'chooseAddress:fail authorize no response')) { data: res
// 通过调用这个方法,让用户重新授权 } = await uni.$http.post('/small/project/address/add', addressObj)
this.reAuth() if (!res.success) return uni.$showMsg()
} this.initAddress();
}, }
// 让用户重新授权
async reAuth() { if (err && (err.errMsg === 'chooseAddress:fail auth deny' || err.errMsg ===
const [err2, confirmResult] = await uni.showModal({ 'chooseAddress:fail authorize no response')) {
content: '检测到您没打开地址权限,是否去设置打开?', // 通过调用这个方法,让用户重新授权
confirmText: '确认', this.reAuth()
cancelText: '取消' }
}) },
// 让用户重新授权
if (err2) return async reAuth() {
const [err2, confirmResult] = await uni.showModal({
console.log(confirmResult) content: '检测到您没打开地址权限,是否去设置打开?',
confirmText: '确认',
if (confirmResult.cancel) return uni.$showMsg('您取消了地址授权!') cancelText: '取消'
if (confirmResult.confirm) return uni.openSetting({ })
success: (settingResult) => {
if (!settingResult.authSetting['scope.address']) return uni.$showMsg('您取消了授权!') if (err2) return
if (settingResult.authSetting['scope.address']) return uni.$showMsg('授权成功!请选择地址')
} console.log(confirmResult)
})
}, if (confirmResult.cancel) return uni.$showMsg('您取消了地址授权!')
async swipeItemClickHandler(item){ if (confirmResult.confirm) return uni.openSetting({
this.addressList = this.addressList.filter(x=>x.guid!=item.guid); success: (settingResult) => {
const { if (!settingResult.authSetting['scope.address']) return uni.$showMsg('您取消了授权!')
data: res if (settingResult.authSetting['scope.address']) return uni.$showMsg(
} = await uni.$http.post('/small/project/address/remove',item.guid) '授权成功!请选择地址')
if (!res.success) return uni.$showMsg() }
}, })
back(){ },
uni.navigateBack({ async swipeItemClickHandler(item) {
delta:1,//返回层数,2则上上页 this.addressList = this.addressList.filter(x => x.guid != item.guid);
}) const {
} data: res
}, } = await uni.$http.post('/small/project/address/remove', item.guid)
computed: { if (!res.success) return uni.$showMsg()
...mapState('m_user', ['address','userId']), },
...mapGetters('m_user', ['addstr']) back() {
} uni.navigateBack({
} delta: 1, //返回层数,2则上上页
})
}
},
computed: {
...mapState('m_user', ['address', 'userId']),
...mapGetters('m_user', ['addstr'])
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@import url("@/static/base_css.css"); @import url("@/static/base_css.css");
.address-border { .mainwrap2 {
display: block; height: calc(100% - 350rpx);
width: 100%; }
height: 5px;
} .address-border {
display: block;
.address-choose-box { width: 100%;
height: 90px; height: 5px;
display: flex; }
justify-content: center;
align-items: center; .address-choose-box {
} display: flex;
position: fixed;
.address-info-box { bottom: 0;
font-size: 12px; padding: 10rpx 0 50rpx 0;
height: 90px; width: 100vw;
display: flex; height: 90rpx;
flex-direction: column; border-top: 1px solid #ddd;
justify-content: center; background-color: #fff;
padding: 0 5px;
.uni-button {
.row1 { margin: 1% 2%;
display: flex; font-size: 30rpx;
justify-content: space-between; width: 55%;
height: 70rpx;
.row1-right { display: flex;
display: flex; align-items: center;
justify-content: space-between; justify-content: center;
align-items: center; background: #1367fe;
} border: 1px solid #1367fe;
} border-radius: 50rpx;
white-space: nowrap;
.row2 { }
display: flex;
align-items: center; .uni-button:first-child {
margin-top: 10px; width: 35%;
background-color: #fff;
.row2-left { color: #1367fe;
white-space: nowrap; }
} }
}
} .address-info-box {
display: flex;
.cart-container { margin: 10rpx 0;
padding-bottom: 50px; padding: 0 10px;
padding: 6% 3%; height: 180rpx;
background: #fff;
border-radius: 20rpx;
font-size: 30rpx;
flex-direction: column;
justify-content: center;
.row1 {
display: flex;
justify-content: space-between;
.row1-right {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.row2 {
display: flex;
align-items: center;
margin-top: 10px;
.row2-left {
white-space: nowrap;
}
}
}
.cart-container {
padding-bottom: 50px;
padding: 6% 3%;
}
.cart-title {
height: 40px;
display: flex;
align-items: center;
padding-left: 5px;
border-bottom: 1px solid #EFEFEF;
.cart-title-text {
font-size: 14px;
margin-left: 10px;
}
}
.goods-item {
width: 750rpx;
box-sizing: border-box;
display: flex;
padding: 10px 5px;
border-bottom: 1px solid #f0f0f0;
.goods-item-left {
margin-right: 5px;
display: flex;
justify-content: space-between;
align-items: center;
.goods-pic {
width: 100px;
height: 100px;
display: block;
}
}
.goods-item-right {
display: flex;
flex: 1;
flex-direction: column;
justify-content: space-between;
.goods-name {
font-size: 13px;
}
.goods-info-box {
display: flex;
justify-content: space-between;
align-items: center;
.goods-price {
color: #C00000;
font-size: 16px;
}
}
}
}
} </style>
.cart-title {
height: 40px;
display: flex;
align-items: center;
padding-left: 5px;
border-bottom: 1px solid #EFEFEF;
.cart-title-text {
font-size: 14px;
margin-left: 10px;
}
}
.goods-item {
width: 750rpx;
box-sizing: border-box;
display: flex;
padding: 10px 5px;
border-bottom: 1px solid #f0f0f0;
.goods-item-left {
margin-right: 5px;
display: flex;
justify-content: space-between;
align-items: center;
.goods-pic {
width: 100px;
height: 100px;
display: block;
}
}
.goods-item-right {
display: flex;
flex: 1;
flex-direction: column;
justify-content: space-between;
.goods-name {
font-size: 13px;
}
.goods-info-box {
display: flex;
justify-content: space-between;
align-items: center;
.goods-price {
color: #C00000;
font-size: 16px;
}
}
}
}
</style>

45
subpkg/complete/complete.vue

@ -54,7 +54,7 @@
</view> </view>
</view> </view>
<view class="popup-share" v-if="showShare"> <view class="popup-share" v-if="showShare">
<view @click="closeShare()" style="margin-left: 250px;">关闭</view> <label @click="closeShare()" class="close-button"></label>
<label class="medimg"><image src="/static/images/medal_1.png"></image></label> <label class="medimg"><image src="/static/images/medal_1.png"></image></label>
<view class="congrat">恭喜你获得1枚成就勋章!</view> <view class="congrat">恭喜你获得1枚成就勋章!</view>
<view class="perinfo"> <view class="perinfo">
@ -260,7 +260,7 @@
left: 50%; left: 50%;
transform: translate(-50%, -10%); transform: translate(-50%, -10%);
width: 300rpx; width: 300rpx;
height: 230rpx; height: 300rpx;
image { image {
width: 100%; width: 100%;
@ -281,8 +281,8 @@
} }
} }
.mainwrap3 { .mainwrap {
top: 56rpx; height: calc(100% - 150rpx);
overflow-y: auto; overflow-y: auto;
} }
@ -393,6 +393,11 @@
.item { .item {
margin: 2% 0; margin: 2% 0;
border-bottom: 1px dotted #ddd; border-bottom: 1px dotted #ddd;
label {
color: #666;
font-size: 1.0rem;
font-weight: 500;
}
} }
} }
} }
@ -435,4 +440,36 @@
height: 100%; height: 100%;
} }
} }
.close-button {
position: absolute;
top: -60rpx;
right: -10rpx;
width: 50rpx;
height: 50rpx;
background-color: rgba(255, 255, 255, .5);
border: 1rpx solid rgba(255, 255, 255, .7);
border-radius: 50%;
transform: rotate(45deg);
}
.close-button:before, .close-button:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
background: #333;
border-radius: 50%;
transform: translate(-50%, -50%);
}
.close-button:before {
height: 24rpx;
width: 4rpx;
}
.close-button:after {
height: 4rpx;
width: 24rpx;
}
</style> </style>

11
subpkg/feedback/feedback.vue

@ -7,7 +7,7 @@
<view class="mainwrap2"> <view class="mainwrap2">
<view class="subwrap"> <view class="subwrap">
<view class="table_index"> <view class="table_index">
<uni-section title="建议与反馈" type="line"></uni-section> <!-- <uni-section title="建议与反馈" type="line"></uni-section> -->
<uni-forms :modelValue="formData"> <uni-forms :modelValue="formData">
<uni-forms-item label="手机" name="mobile"> <uni-forms-item label="手机" name="mobile">
<uni-easyinput type="text" v-model="formData.mobile" placeholder="请输入手机号码" /> <uni-easyinput type="text" v-model="formData.mobile" placeholder="请输入手机号码" />
@ -69,18 +69,21 @@
</script> </script>
<style scoped> <style scoped>
@import url("@/static/base_css.css"); @import url("@/static/base_css.css");
.table_index { .table_index {
background-color: #fff; background-image: linear-gradient(to bottom, #fff, transparent);
height: 100%; height: 100%;
padding: 50px 30px; padding: 50px 30px;
border-radius: 3%; border-radius: 3%;
} }
.uni-button{ .uni-button {
font-size: 18px; font-size: 30rpx;
width: 100%; width: 100%;
height: 70rpx; height: 70rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: #1367fe;
border-radius: 50rpx;
} }
</style> </style>

15
subpkg/knowledgeInfo/knowledgeInfo.vue

@ -2,9 +2,10 @@
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="stabar"></view>
<view class="secbar"><label class="back" @click="back()"></label> <view class="secbar"><label class="back" @click="back()"></label>
<view class="title"></view>
</view> </view>
<view class="mainwrap2"> <view class="mainwrap2">
<view class="title">“三类场所”消防安全提示!“三类场所”消防安全提示!</view>
<view class="timetop">2024-03-04 11:33</view>
<view class="subwrap"> <view class="subwrap">
<view v-html="content"></view> <view v-html="content"></view>
</view> </view>
@ -46,4 +47,16 @@
<style lang="scss"> <style lang="scss">
@import url("@/static/base_css.css"); @import url("@/static/base_css.css");
.mainwrap2 .title {
margin: 0 3% 3%;
text-align: left;
}
.timetop {
margin: 0 3% 3%;
color: #999;
font-size: 0.9rem;
}
.subwrap {
height: calc(100% - 200rpx);
}
</style> </style>

2
subpkg/list/list.vue

@ -133,7 +133,7 @@
.mainwrap3 { .mainwrap3 {
top: 50rpx; top: 50rpx;
height: calc(100% - 90rpx) height: calc(100% - 160rpx)
} }
swiper { swiper {

4
subpkg/practice/practice.vue

@ -62,9 +62,11 @@
.secbar label.back { .secbar label.back {
position: absolute; position: absolute;
top: 6rpx; top: 0;
left: 4%; left: 4%;
padding-left: 0; padding-left: 0;
width: 50rpx;
height: 50rpx;
background: url(/static/images/icon_arbw.png) no-repeat left 40% center; background: url(/static/images/icon_arbw.png) no-repeat left 40% center;
background-size: auto 50%; background-size: auto 50%;
background-color: rgba(255, 255, 255, .2); background-color: rgba(255, 255, 255, .2);

3
subpkg/privacy/privacy.vue

@ -47,4 +47,7 @@
<style lang="scss"> <style lang="scss">
@import url("@/static/base_css.css"); @import url("@/static/base_css.css");
.subwrap > view {
margin: 0 2% 10% 2%;
}
</style> </style>

2
subpkg/review/review.vue

@ -125,7 +125,7 @@
overflow: hidden; overflow: hidden;
} }
.question-item image { .question-item image, .question-list image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }

12
subpkg/role/role.vue

@ -5,7 +5,7 @@
<view class="mainwrap3"> <view class="mainwrap3">
<img src="/static/images/bg_role.jpg" alt=""/> <img src="/static/images/bg_role.jpg" alt=""/>
<view class="role_wrap"> <view class="role_wrap">
<view class="<strong>contit</strong>">请选择您在“<font style="color:#fd6d1f;">{{sceneName}}</font>”演练中的角色:</view> <view class="contit">请选择您在“<font style="color:#fd6d1f;">{{sceneName}}</font>”演练中的角色:</view>
<view class="role_box"> <view class="role_box">
<block class="role-item" v-for="(item,i) in roleList" :key="i"> <block class="role-item" v-for="(item,i) in roleList" :key="i">
<span :class="item.choose === 'true' ? 'change_color':''" @click="chooseRole(item)" v-if="i<3">{{item.name}}</span> <span :class="item.choose === 'true' ? 'change_color':''" @click="chooseRole(item)" v-if="i<3">{{item.name}}</span>
@ -138,7 +138,7 @@
} }
.mainwrap3 { .mainwrap3 {
top: 0; top: 0;
height: calc(100% - 70px); height: 100%;
overflow: hidden; overflow: hidden;
} }
@ -155,8 +155,12 @@
width: 94%; width: 94%;
} }
.contit {
margin-left: 2%;
}
.role_box { .role_box {
margin: 1% 0 2% 4%; margin: 4% 0 2% 2%;
width: 96%; width: 96%;
} }
@ -195,7 +199,7 @@
.startbtn { .startbtn {
position: relative; position: relative;
z-index: 1; z-index: 1;
bottom: 35%; bottom: 40%;
width: 100%; width: 100%;
height: 30%; height: 30%;
background:no-repeat 47.5% center; background:no-repeat 47.5% center;

Loading…
Cancel
Save