Browse Source

【完善】 评级中心、收货地址、收货地址新增编辑、评卡查询页面的交互

master
邓平艺 4 years ago
parent
commit
a7d4c3b7d8
  1. 108
      packages/addAddress/addAddress.vue
  2. 112
      packages/address/address.vue
  3. 2
      pages.json
  4. 100
      pages/index/index.vue
  5. 19
      pages/order/order.vue
  6. 24
      pages/ratingQuery/ratingQuery.vue
  7. 9
      pages/settings/settings.vue
  8. BIN
      static/icon/rightArrow.png
  9. BIN
      static/icon/search.png
  10. 30
      styles/iconFont.css

108
packages/addAddress/addAddress.vue

@ -3,32 +3,34 @@
<view class="flex-col group_4">
<view class="flex-col section_2">
<view class="top-group flex-row">
<text class="text_2">收货人</text>
<text class="text_3">请填写收货人姓名</text>
<text class="text_2 lf-m-r-18">收货人</text>
<u-input class="input" v-model="address.name" placeholder="请填写收货人姓名" border="surround" :clearable="true" ></u-input>
</view>
<view class="top-group flex-row">
<text class="text_4">手机号码</text>
<text class="text_5">请填写收货人手机号码</text>
<text class="text_4 lf-m-r-18">手机号码</text>
<u-input class="input" v-model="address.phone" placeholder="请填写收货人手机号码" border="surround" maxlength="11" :clearable="true" ></u-input>
</view>
<view class="flex-col group_5">
<view class="top-group justify-between">
<view class="flex-row">
<text class="text_6">所在地区</text>
<text class="text_7">请选择所在地区</text>
</view>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
class="image_6"
/>
</view>
<view class="flex-row group_7">
<text class="text_8">详细地址</text>
<text class="text_9">请填写详细地址如道路门牌号楼栋号单元室等</text>
<picker mode="region" :value="address.region" @change="pickerChnage">
<view class="top-group justify-between">
<view class="flex-row">
<text class="text_6 lf-m-r-18">所在地区</text>
<text class="text_7" :class="{'black-color': regionNotEmpty}">{{ address.region.length > 0 ? address.region.join(',') : '请选择所在地区' }}</text>
</view>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
class="image_6"
/>
</view>
</picker>
<view class="flex-row group_7" style="align-items: flex-start;">
<text class="text_8 lf-m-r-18 lf-m-t-12">详细地址</text>
<u-textarea v-model="address.address" placeholder="请填写详细地址:如道路、门牌号、楼栋号、单元室等" ></u-textarea>
</view>
</view>
</view>
<view class="flex-col group_8">
<view class="flex-col items-center button">
<view class="flex-col items-center button" @click="save">
<text>保存</text>
</view>
<view class="section_3"> </view>
@ -40,8 +42,57 @@
<script>
export default {
data() {
return {};
return {
id: null,
address: {
name: '',
phone: '',
region: [],
address: ''
}
};
},
computed: {
regionNotEmpty(){
return this.address.region.length > 0;
}
},
onLoad(options){
this.id = options.id || null;
this.id && this.getAddressDetail();
},
onReady(){
let title = '新增收货地址';
if(this.id){
title = '编辑收货地址';
}
uni.setNavigationBarTitle({
title: title
})
},
methods: {
// id
getAddressDetail(){
this.address = {
name: '邓平艺',
phone: '1878455554',
region: ['北京市','北京市','东城区'],
address: '北京北京市海淀区钻石大厦C座'
}
},
pickerChnage(event){
console.log(event);
this.address.region = event.detail.value;
},
save(){
console.log(this.address)
if(this.id){
this.$msg('编辑')
}else{
this.$msg('新增')
}
}
}
};
</script>
@ -56,6 +107,7 @@
overflow-y: auto;
height: 100%;
}
.group_4 {
padding-top: 2rpx;
flex: 1 1 auto;
@ -96,6 +148,7 @@
font-weight: 500;
line-height: 44rpx;
white-space: nowrap;
width: 140rpx;
}
.text_3 {
margin-left: 72rpx;
@ -110,6 +163,7 @@
font-weight: 500;
line-height: 44rpx;
white-space: nowrap;
width: 140rpx;
}
.text_5 {
margin-left: 40rpx;
@ -132,6 +186,7 @@
font-weight: 500;
line-height: 44rpx;
white-space: nowrap;
width: 140rpx;
}
.text_9 {
margin-left: 40rpx;
@ -147,12 +202,23 @@
font-weight: 500;
line-height: 44rpx;
white-space: nowrap;
width: 140rpx;
}
.text_7 {
margin-left: 40rpx;
margin-left: 18rpx;
color: rgb(195, 195, 195);
font-size: 32rpx;
font-size: 28rpx;
line-height: 44rpx;
white-space: nowrap;
max-width: 440rpx;
overflow:hidden;
text-overflow:ellipsis;
}
.flex-row{
display: flex;
align-items: center;
}
.black-color{
color: #303133 !important;
}
</style>

112
packages/address/address.vue

@ -1,67 +1,30 @@
<template>
<view style="flex-direction: column;">
<scroll-view>
<view class="addressItem">
<scroll-view class="scroll-view" :scroll-y="true">
<view class="addressItem" v-for="(item, index) in addressList" :key="item.id">
<view class="addressItemTop">
<text class="addrName">名字</text>
<text class="addrTel">18688888888</text>
<text class="addrName">{{ item.name }}</text>
<text class="addrTel">{{ item.phone }}</text>
</view>
<text class="addr">地址地址</text>
<text class="addr">{{ item.address }}</text>
<view class="line"></view>
<view class="optionsPanel">
<view>
<image class="checkBtn" src="../../static/勾选.png"></image>
<text>设置为默认地址</text>
</view>
<view class="rightPanel">
<image class="optionsBtn" src="../../static/删除.png"></image>
<image class="optionsBtnEdit" src="../../static/编辑.png"></image>
</view>
</view>
<view style="height: 30rpx;background-color: #F6F6F6;"></view>
</view>
<view class="addressItem">
<view class="addressItemTop">
<text class="addrName">名字</text>
<text class="addrTel">18688888888</text>
</view>
<text class="addr">地址地址</text>
<view class="line"></view>
<view class="optionsPanel">
<view>
<image class="checkBtn" src="../../static/勾选.png"></image>
<text>设置为默认地址</text>
</view>
<radio-group @change="radioChange">
<label>
<radio :value="item.id" :checked="item.isDefault" color="#e7a23f"></radio>
<text>设置为默认地址</text>
</label>
</radio-group>
<view class="rightPanel">
<image class="optionsBtn" src="../../static/删除.png"></image>
<image class="optionsBtnEdit" src="../../static/编辑.png"></image>
</view>
</view>
<view style="height: 30rpx;background-color: #F6F6F6;"></view>
</view>
<view class="addressItem">
<view class="addressItemTop">
<text class="addrName">名字</text>
<text class="addrTel">18688888888</text>
</view>
<text class="addr">地址地址</text>
<view class="line"></view>
<view class="optionsPanel">
<view>
<image class="checkBtn" src="../../static/勾选.png"></image>
<text>设置为默认地址</text>
</view>
<view class="rightPanel">
<image class="optionsBtn" src="../../static/删除.png"></image>
<image class="optionsBtnEdit" src="../../static/编辑.png"></image>
<image class="optionsBtn" src="../../static/删除.png" @click="remove"></image>
<image class="optionsBtnEdit" src="../../static/编辑.png" @click="$url('/packages/addAddress/addAddress?id='+ item.id)"></image>
</view>
</view>
<view style="height: 30rpx;background-color: #F6F6F6;"></view>
</view>
</scroll-view>
<view class="addNewAddr" @click="toNewAddr">
<view></view>
<text>新增地址</text>
<view class="addNewAddr" @click="$url('/packages/addAddress/addAddress')">
<text>+ 新增收获地址</text>
</view>
</view>
</template>
@ -70,14 +33,40 @@
export default {
data() {
return {
addressList: [{
id: '1',
name: '邓平艺',
phone: '18454545455',
address: '北京北京市海淀区钻石大厦C座',
isDefault: true
},{
id: '2',
name: '邓艺平',
phone: '18454545455',
address: '北京北京市海淀区钻石大厦C座',
isDefault: false
},{
id: '3',
name: '洛阳',
phone: '18454545455',
address: '北京北京市海淀区钻石大厦C座',
isDefault: false
}]
}
},
methods: {
toNewAddr(){
uni.navigateTo({
url:"../addAddress/addAddress"
})
radioChange(event){
let id = event.detail.value;
this.addressList.forEach(item => {
if(item.id === id){
item.isDefault = true;
}else{
item.isDefault = false;
}
});
},
remove(){
this.$msg('删除')
}
}
}
@ -88,6 +77,10 @@
display: flex;
background-color: #FFFFFF;
}
.scroll-view{
height: calc(100vh - 200rpx);
}
.checkBtn{
width: 44rpx;
@ -143,14 +136,15 @@
height: 96rpx;
/* width: 90%; */
width: 686rpx;
border: #E7A23F 1rpx solid;
border: #E7A23F 2rpx solid;
border-radius: 8rpx;
position: fixed;
bottom: 200rpx;
bottom: 100rpx;
left: calc(50% - 343rpx);
justify-content: center;
align-items: center;
align-self: center;
color: #E7A23F;
}
</style>

2
pages.json

@ -72,7 +72,7 @@
"pages": [{
"path": "addAddress/addAddress",
"style": {
"navigationBarTitleText": "新增收货地址",
"navigationBarTitleText": " ",
"enablePullDownRefresh": false
}
},{

100
pages/index/index.vue

@ -2,7 +2,7 @@
<view class="flex-col page">
<lf-header :spreadOut="true" :diy="true" :boderBottom="true" bgColor="#ffffff">
<view class="header-nav">
<image class="searchIcon" src="@/static/搜索.png" @click="$url('/pages/ratingQuery/ratingQuery')"></image>
<image class="searchIcon" src="@/static/icon/search.png" @click="$url('/pages/ratingQuery/ratingQuery')"></image>
<text class="title">评级中心</text>
</view>
</lf-header>
@ -16,6 +16,7 @@
<view class="flex-col section_3" @click="$url('/pages/settings/settings')">
<view class="bottom-group flex-col items-center view_3">
<view class="flex-col items-end image-wrapper">
<image class="avatar" src="../../static/mrtx.png" mode="aspectFill"></image>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497944681815904.png"
class="image_7" />
@ -25,10 +26,8 @@
</view>
</view>
<view class="justify-center group_5">
<text>*</text>
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497755447138115.png"
class="image_8" />
<view class="user-name">*</view>
<image src="@/static/icon/rightArrow.png" class="image_8" />
</view>
</view>
<!-- 我的订单 -->
@ -38,12 +37,12 @@
<view class="right-group flex-row" @click="$url('/pages/order/order')">
<text>全部</text>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
src="@/static/icon/rightArrow.png"
class="image_8" />
</view>
</view>
<view class="justify-between equal-division" @click="$url('/pages/order/order')">
<view class="equal-division-item flex-col" >
<view class="justify-between equal-division" >
<view class="equal-division-item flex-col" @click="$url('/pages/order/order?current=1')">
<view class="top-group flex-col items-center">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497746086268452.png"
@ -54,19 +53,19 @@
</view>
<text class="text_7">待确认</text>
</view>
<view class="flex-col items-center equal-division-item_1">
<view class="flex-col items-center equal-division-item_1" @click="$url('/pages/order/order?current=2')">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497746226999392.png"
class="image_11" />
<text class="text_9">评级中</text>
</view>
<view class="flex-col items-center equal-division-item_2">
<view class="flex-col items-center equal-division-item_2" @click="$url('/pages/order/order?current=3')">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497746138565873.png"
class="image_11" />
<text class="text_11">待付款</text>
</view>
<view class="equal-division-item flex-col">
<view class="equal-division-item flex-col" @click="$url('/pages/order/order?current=4')">
<view class="top-group flex-col items-center">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497746181954101.png"
@ -89,40 +88,38 @@
<view class="right-group flex-row" @click="$url('/pages/fastRating/fastRating')">
<text>查看详情</text>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
src="@/static/icon/rightArrow.png"
class="image_8" />
</view>
</view>
<view class="grid">
<view class="flex-col items-center grid-item">
<image
<view class="flex-col items-center grid-item_1" @click="rateIndex = 0" :class="{'grid-item-active': rateIndex == 0}">
<!-- <image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497754868753243.png"
class="image_17" />
class="image_17" /> -->
<text class="qxk-iconfont qxk-icon-mulu lf-font-40"></text>
<text class="text_17">全面评级</text>
</view>
<view class="flex-col items-center grid-item_1">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497754706422513.png"
class="image_17" />
<view class="flex-col items-center grid-item_1" @click="rateIndex = 1" :class="{'grid-item-active': rateIndex == 1}">
<text class="qxk-iconfont qxk-icon-xinwen-moren lf-font-40"></text>
<text class="text_9">卡品评级</text>
</view>
<view class="grid-item_2 flex-col items-center">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497754475187308.png"
class="image_17" />
<view class="grid-item_2 flex-col items-center" @click="rateIndex = 2" :class="{'grid-item-active': rateIndex == 2}">
<text class="qxk-iconfont qxk-icon-tuwenguanli lf-font-40"></text>
<text class="text_19">签名评级</text>
</view>
<view class="grid-item_2 flex-col items-center">
<image
src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497754361023096.png"
class="image_17" />
<view class="grid-item_2 flex-col items-center" @click="rateIndex = 3" :class="{'grid-item-active': rateIndex == 3}">
<text class="qxk-iconfont qxk-icon-kefujiqirenbeifen lf-font-40"></text>
<text class="text_19">套壳服务</text>
</view>
</view>
<view class="flex-col group_11">
<view class="justify-between group_12">
<view class="flex-row">
<view class="section_7"> </view>
<!-- <view class="section_7"> </view> -->
<checkbox-group>
<checkbox color="#e6a33c"></checkbox>
</checkbox-group>
<view class="group_14">
<text class="text_22">阅读并同意</text>
<text class="text_23">相关协议</text>
@ -140,7 +137,7 @@
<view class="justify-between group_15" @click="$url('/pages/order/order')">
<text>已评卡</text>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
src="@/static/icon/rightArrow.png"
class="image_8" />
</view>
<view class="flex-row equal-division_1">
@ -168,11 +165,10 @@
<view class="justify-between section_9" @click="$url('/pages/ratingCriteria/ratingCriteria')">
<text>评级标准/卡砖设计</text>
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497893779891395.png"
src="@/static/icon/rightArrow.png"
class="image_8" />
</view>
</view>
<view class="section_10"> </view>
</view>
</view>
</view>
@ -185,7 +181,9 @@
lfHeader
},
data() {
return {};
return {
rateIndex: 0
};
},
};
</script>
@ -318,14 +316,6 @@
position: absolute;
}
.section_10 {
margin-top: 84rpx;
align-self: center;
background-color: rgb(0, 0, 0);
border-radius: 4rpx;
width: 196rpx;
height: 8rpx;
}
.section_3 {
padding: 40rpx 0 38rpx;
@ -408,10 +398,15 @@
.image-wrapper {
padding-top: 72rpx;
background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497753952125194.png');
background-size: 100% 100%;
background-repeat: no-repeat;
width: 112rpx;
position: relative;
.avatar{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.badge {
@ -463,6 +458,10 @@
border-radius: 10rpx;
border: solid 2rpx rgb(231, 162, 63);
}
.grid-item-active{
color: rgb(231, 162, 63) !important;
border: solid 2rpx rgb(231, 162, 63) !important;
}
.grid-item_1 {
padding: 22rpx 0 30rpx;
@ -507,6 +506,8 @@
border-radius: 50%;
width: 40rpx;
height: 40rpx;
position: relative;
z-index: 99;
}
.text_11 {
@ -553,7 +554,7 @@
.badge_1 {
background-color: rgb(234, 43, 43);
border-radius: 13rpx;
width: 26rpx;
min-width: 26rpx;
position: absolute;
right: 6rpx;
top: 0;
@ -592,4 +593,15 @@
font-size: 28rpx;
line-height: 40rpx;
}
.user-name{
max-width: 360rpx;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
/deep/checkbox .wx-checkbox-input {
border-radius: 50% !important;
}
</style>

19
pages/order/order.vue

@ -79,7 +79,6 @@
</view>
</view>
<view class="flex-col items-center group_15">
<view class="section_6"> </view>
<view class="section_7"> </view>
</view>
</view>
@ -198,7 +197,7 @@
requestFunction: 'getList',
...publicKey
}],
tabIndex: 4,
tabIndex: 0,
scenic: {}
}
},
@ -217,7 +216,8 @@
return `calc(100vh - 80rpx - 10rpx)`;
}
},
onLoad(){
onLoad(options){
this.tabIndex = Number(options.current || this.tabIndex);
this.scenic = uni.getStorageSync("scenic_key") || {};
this[ this.tabList[this.tabIndex].requestFunction ](); // tab
},
@ -248,12 +248,10 @@
}, 800);
},
// tab
switchTab(current){
this.tabIndex = current;
switchTab(item){
this.tabIndex = item.index;
// tabisPagetrue
let tabItem = this.tabList[this.tabIndex];
// todo ...
console.log("tabItem", tabItem, current)
if(tabItem.data.length === 0 && tabItem.isPage){
this[ tabItem.requestFunction ]();
}
@ -361,12 +359,7 @@
.group_14 {
margin-top: 50rpx;
}
.section_6 {
background-color: rgb(0, 0, 0);
border-radius: 4rpx;
width: 196rpx;
height: 8rpx;
}
.section_7 {
background-color: rgba(0, 0, 0, 0.5);
width: 750rpx;

24
pages/ratingQuery/ratingQuery.vue

@ -3,14 +3,8 @@
<view class="flex-col section_2">
<view class="flex-col section_3">
<view class="justify-between search">
<view class="flex-row group_4">
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/62677e395a7e3f03107ffc5f/62677e4a35a7e10011e93a80/16509497990103652578.png"
class="image_6"
/>
<text class="text_2">请输入评级编号</text>
</view>
<view class="flex-col items-center text-wrapper" @click="$url('/packages/ratingQueryDetail/ratingQueryDetail')">
<u-input class="search-input" v-model="value" placeholder="请输入评级编号" border="surround" :clearable="true" ></u-input>
<view class="flex-col items-center text-wrapper" @click="search">
<text>搜索</text>
</view>
</view>
@ -23,8 +17,16 @@
<script>
export default {
data() {
return {};
return {
value: ''
};
},
methods: {
search(){
console.log('搜索', this.value);
this.$url('/packages/ratingQueryDetail/ratingQueryDetail');
}
}
};
</script>
@ -35,6 +37,10 @@
overflow-y: auto;
height: 100%;
}
.search-input{
width: 492rpx;
height: 84rpx;
}
.section_2 {
padding: 32rpx 32rpx 16rpx;
flex: 1 1 auto;

9
pages/settings/settings.vue

@ -1,16 +1,15 @@
<template>
<view>
<u-cell-group :border="false">
<u-cell title="头像" :isLink="true" :border="false">
<u-cell title="头像" :isLink="true" :border="false" @click="$msg('敬请期待')">
<u-avatar size="40" slot="value" :src="src"></u-avatar>
</u-cell>
<u-cell title="昵称" :isLink="true" :border="false"></u-cell>
<u-cell title="手机号码" :isLink="true" :border="false"></u-cell>
<u-cell title="昵称" :isLink="true" :border="false" @click="$msg('敬请期待')"></u-cell>
<u-cell title="手机号码" :isLink="true" :border="false" @click="$msg('敬请期待')"></u-cell>
<u-cell title="收货地址" :isLink="true" :border="false" url="/packages/address/address"></u-cell>
<u-cell title="系统消息" :isLink="true" :border="false">
<u-cell title="系统消息" :isLink="true" :border="false" @click="$msg('敬请期待')">
<u-badge class="badge" slot="value" numberType="overflow" max="99" :value="99"></u-badge>
</u-cell>
</u-cell-group>
</view>
</template>

BIN
static/icon/rightArrow.png

After

Width: 44  |  Height: 44  |  Size: 351 B

BIN
static/icon/search.png

After

Width: 38  |  Height: 36  |  Size: 1.4 KiB

30
styles/iconFont.css

@ -0,0 +1,30 @@
@font-face {
font-family: "qxk-iconfont"; /* Project id 3366366 */
src: url('//at.alicdn.com/t/font_3366366_z00q2fmfnp.woff2?t=1651192172384') format('woff2'),
url('//at.alicdn.com/t/font_3366366_z00q2fmfnp.woff?t=1651192172384') format('woff'),
url('//at.alicdn.com/t/font_3366366_z00q2fmfnp.ttf?t=1651192172384') format('truetype');
}
.qxk-iconfont {
font-family: "qxk-iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.qxk-icon-tuwenguanli:before {
content: "\e62d";
}
.qxk-icon-xinwen-moren:before {
content: "\e61d";
}
.qxk-icon-mulu:before {
content: "\e63e";
}
.qxk-icon-kefujiqirenbeifen:before {
content: "\e7ab";
}
Loading…
Cancel
Save