收货地址

msb_beta
ch 3 years ago
parent d88ebdbd99
commit 99c802a8d5

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2019-04-01 01:47:12
* @LastEditors: ch
* @LastEditTime: 2022-03-28 16:44:23
* @LastEditTime: 2022-03-29 10:29:13
* @Description: file content
-->
<script>
@ -12,6 +12,8 @@
},
onShow: function() {
console.log('App Show')
// console.log(this.$route);
},
onHide: function() {
console.log('App Hide')

@ -2,16 +2,17 @@
* @Author: ch
* @Date: 2022-03-22 18:28:52
* @LastEditors: ch
* @LastEditTime: 2022-03-28 11:11:18
* @LastEditTime: 2022-03-29 11:08:32
* @Description: file content
*/
import Vue from 'vue'
import Vuex from 'vuex';
Vue.use(Vuex)
export default new Vuex.Store({
state : {
token : uni.getStorageSync('tk') : ''
token : uni.getStorageSync('tk') || ''
},
mutations:{
SET_TOKEN (state, token = ''){

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-20 13:11:55
* @LastEditors: ch
* @LastEditTime: 2022-03-26 14:28:15
* @LastEditTime: 2022-03-29 15:04:36
* @Description: file content
-->
<template>
@ -16,7 +16,6 @@
</template>
<script>
// import icon from '@/static/message/empty.png'
export default {
data(){
return {

@ -1,56 +0,0 @@
<!--
* @Author: ch
* @Date: 2022-03-23 16:05:10
* @LastEditors: ch
* @LastEditTime: 2022-03-23 16:32:42
* @Description: file content
-->
<template>
<view class="search">
<image class="search--icon" src="@/static/search/arrow.png" @click="$Router.back()"></image>
<u--input class="search--input" :placeholder="placeholder" @focus="$Router.push('/pages/goods/search')"
prefixIcon="search" clearable prefixIconStyle="font-size:48rpx;color:#ccc"
v-model="value" placeholderClass="search--input__placeholder"></u--input>
</view>
</template>
<script>
export default {
props: {
value : {
type : String,
default : ''
},
placeholder : {
type : String,
default : '请输入您想搜索的商品名称'
}
}
}
</script>
<style lang="scss" scoped>
.search{
height: 88rpx;
padding: 0 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
&--icon{
width: 14rpx;
height: 28rpx;
}
&--input{
display: block;
margin-left:40rpx;
height: 70rpx;
border:none;
box-sizing: border-box;
background: #F8F8F8;
&__placeholder{
font-size: 26rpx;
color: #666;
}
}
}
</style>

@ -0,0 +1,100 @@
<!--
* @Author: ch
* @Date: 2022-03-29 16:05:06
* @LastEditors: ch
* @LastEditTime: 2022-03-29 16:20:03
* @Description: file content
-->
<template>
<view>
<UiCell title="所在区域" @click="show = true">
<template slot="value">
<input class="cityInput" disabled value="我的" placeholder="请选择省市区" />
</template>
</UiCell>
<u-picker
:show="show"
keyName="label"
:columns="data"
@cancel="show = false"
@change="changeRegion"
@confirm="onConfirm"
/>
</view>
</template>
<script>
import UiCell from "./UiCell";
export default {
components: { UiCell },
props: ["value"],
data() {
return {
show: false,
data: [
[
{
label: "北京",
id: 11000000,
children: [
{
label: "东城",
id: 11100000,
},
{
label: "西城",
id: 11200000,
},
],
},
{
label: "湖南",
id: 43000000,
children: [
{
label: "长沙",
id: 11100000,
},
{
label: "邵阳",
id: 11200000,
},
],
},
],
[
{
label: "东城",
id: 11100000,
},
{
label: "西城",
id: 11200000,
},
],
],
};
},
computed:{
valueText(){
// this.va
},
},
methods: {
changeCity(val) {
this.data = [this.options[0],val.value[0].children]
},
confirm(value) {
this.$emit('input', value)
this.$emit('change', value)
},
},
};
</script>
<style lang="scss" scoped>
.cityInput{
flex: 1;
font-size: 28rpx;
padding-left: 40rpx;
}
</style>

@ -2,11 +2,11 @@
* @Author: ch
* @Date: 2022-03-26 10:06:38
* @LastEditors: ch
* @LastEditTime: 2022-03-28 18:18:15
* @LastEditTime: 2022-03-29 15:45:08
* @Description: file content
-->
<template>
<button class="btn" :class="`btn__${type}`" @click="$emit('click')"><slot></slot></button>
<button :class="`btn btn__${type} btn__${size}`" @click="$emit('click')"><slot></slot></button>
</template>
<script>
export default {
@ -14,6 +14,10 @@ export default {
type : {
type : String,
default : 'line' //gradual solid line线 primaryLine
},
size : {
type : String,
default : 'normal' //normal 60 max 80
}
}
}
@ -21,21 +25,27 @@ export default {
<style lang="scss" scoped>
.btn{
display: inline-block;
font-size: 28rpx;
height: 62rpx;
line-height: 62rpx;
padding: 0 50rpx;
text-align: center;
border-radius: 50rpx;
display: flex;
align-items: center;
justify-content: center;
&__normal{
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
}
&__max{
width: 690rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
}
&__gradual{
height: 64rpx;
line-height: 64rpx;
background: linear-gradient(270deg, #FF7F39 0%, #FFA35B 100%);
color: #fff;
}
&__solid{
height: 64rpx;
line-height: 64rpx;
background: #FF875B;
color: #fff;
}

@ -2,17 +2,20 @@
* @Author: ch
* @Date: 2021-07-26 23:22:16
* @LastEditors: ch
* @LastEditTime: 2022-03-22 17:47:44
* @LastEditTime: 2022-03-29 11:14:39
* @Description: file content
*/
import Vue from 'vue';
import App from './App';
import {router,RouterMount} from './common/router/index.js';
import {router,RouterMount} from '@/common/router/index.js';
import uView from 'uview-ui';
import store from '@/common/store'
Vue.use(router);
Vue.use(uView);
Vue.prototype.$store = store
Vue.config.productionTip = false;

@ -76,7 +76,7 @@
"devServer" : {
"proxy" : {
"/user/" : {
"target": "http://192.168.31.102:4500/"
"target": "http://192.168.10.251:4500/"
}
}
}

@ -17,7 +17,8 @@
"mp-html": "^2.2.2",
"uni-read-pages": "^1.0.5",
"uni-simple-router": "^2.0.7",
"uview-ui": "^2.0.29"
"uview-ui": "^2.0.29",
"vuex": "^3.6.2"
},
"devDependencies": {
"@dcloudio/uni-helper-json": "^1.0.13"

@ -33,6 +33,7 @@
},
{
"path": "pages/goods/search",
"aliasPath" : "/search",
"style": {
"navigationStyle" : "custom",
"navigationBarTitleText": "uni-app"
@ -40,6 +41,7 @@
},
{
"path": "pages/goods/list/index",
"aliasPath" : "/goodsList",
"style": {
"navigationStyle" : "custom",
"navigationBarTitleText": "uni-app"
@ -99,17 +101,25 @@
{
"path": "pages/account/address/list",
"aliasPath" : "/addressList",
"style": {
"navigationStyle" : "custom",
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "收货地址"
}
},
{
"path": "pages/account/address/create",
"aliasPath" : "/addressCreate",
"style": {
"navigationStyle" : "custom",
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "新增收货地址"
}
},
{
"path": "pages/account/address/edit",
"aliasPath" : "/addressEdit",
"style": {
"navigationBarTitleText": "编辑收货地址"
}
},
{

@ -0,0 +1,188 @@
<!--
* @Author: ch
* @Date: 2022-03-22 14:12:18
* @LastEditors: ch
* @LastEditTime: 2022-03-22 16:31:24
* @Description: file content
-->
<template>
<view class="container">
<!-- 标题 -->
<view class="page-title">收货地址</view>
<!-- 表单组件 -->
<view class="form-wrapper">
<u-form :model="form" ref="uForm" label-width="140rpx">
<u-form-item label="姓名" prop="name">
<u-input v-model="form.name" placeholder="请输入收货人姓名" />
</u-form-item>
<u-form-item label="电话" prop="phone">
<u-input v-model="form.phone" placeholder="请输入收货人手机号" />
</u-form-item>
<u-form-item label="地区" prop="region">
<select-region v-model="form.region" />
</u-form-item>
<u-form-item label="详细地址" prop="detail" :border-bottom="false">
<u-input v-model="form.detail" placeholder="街道门牌、楼层等信息" />
</u-form-item>
</u-form>
</view>
<!-- 操作按钮 -->
<view class="footer">
<view class="btn-wrapper">
<view class="btn-item btn-item-main" :class="{ disabled }" @click="handleSubmit()"></view>
</view>
</view>
</view>
</template>
<script>
import SelectRegion from '@/components/SelectRegion.vue'
import { isPhone } from '@/common/utils/utils'
// import * as AddressApi from '@/api/address'
//
const form = {
name: '',
phone: '',
region: [],
detail: ''
}
//
const rules = {
name: [{
required: true,
message: '请输入姓名',
trigger: ['blur', 'change']
}],
phone: [{
required: true,
message: '请输入手机号',
trigger: ['blur', 'change']
}, {
//
validator: (rule, value, callback) => {
// truefalse
return isPhone(value)
},
message: '手机号码不正确',
// blurchange
trigger: ['blur'],
}],
region: [{
required: true,
message: '请选择省市区',
trigger: ['blur', 'change'],
type: 'array'
}],
detail: [{
required: true,
message: '请输入详细地址',
trigger: ['blur', 'change']
}],
}
export default {
components: {
SelectRegion
},
data() {
return {
form,
rules,
//
disabled: false
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
// onReadyonLoad
onReady() {
this.$refs.uForm.setRules(this.rules)
},
methods: {
//
handleSubmit() {
const app = this
if (app.disabled) {
return false
}
app.$refs.uForm.validate(valid => {
if (valid) {
app.disabled = true
AddressApi.add(app.form)
.then(result => {
app.$toast(result.message)
uni.navigateBack()
})
.finally(() => app.disabled = false)
}
})
}
}
}
</script>
<style>
page {
background: #f7f8fa;
}
</style>
<style lang="scss" scoped>
.page-title {
width: 94%;
margin: 0 auto;
padding-top: 40rpx;
font-size: 28rpx;
color: rgba(69, 90, 100, 0.6);
}
.form-wrapper {
margin: 20rpx auto 20rpx auto;
padding: 0 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
}
/* 底部操作栏 */
.footer {
margin-top: 60rpx;
.btn-wrapper {
height: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.btn-item {
flex: 1;
font-size: 28rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
color: #fff;
border-radius: 50rpx;
}
.btn-item-main {
background: linear-gradient(to right, #f9211c, #ff6335);
//
&.disabled {
background: #ff9779;
}
}
}
</style>

@ -2,187 +2,78 @@
* @Author: ch
* @Date: 2022-03-22 14:12:18
* @LastEditors: ch
* @LastEditTime: 2022-03-22 16:31:24
* @LastEditTime: 2022-03-29 16:27:03
* @Description: file content
-->
<template>
<view class="container">
<!-- 标题 -->
<view class="page-title">收货地址</view>
<!-- 表单组件 -->
<view class="form-wrapper">
<u-form :model="form" ref="uForm" label-width="140rpx">
<u-form-item label="姓名" prop="name">
<u-input v-model="form.name" placeholder="请输入收货人姓名" />
</u-form-item>
<u-form-item label="电话" prop="phone">
<u-input v-model="form.phone" placeholder="请输入收货人手机号" />
</u-form-item>
<u-form-item label="地区" prop="region">
<select-region v-model="form.region" />
</u-form-item>
<u-form-item label="详细地址" prop="detail" :border-bottom="false">
<u-input v-model="form.detail" placeholder="街道门牌、楼层等信息" />
</u-form-item>
</u-form>
</view>
<!-- 操作按钮 -->
<view class="footer">
<view class="btn-wrapper">
<view class="btn-item btn-item-main" :class="{ disabled }" @click="handleSubmit()"></view>
</view>
</view>
</view>
<view class="container">
<view class="form">
<UiCell class="form--item" title="收货人" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入收货人姓名"/>
</template>
</UiCell>
<UiCell class="form--item" title="手机号码" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入收货手机号码"/>
</template>
</UiCell>
<BsSelectCity class="form--item form--city"></BsSelectCity>
<UiCell class="form--item form--item__last" title="详细地址" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入详细地址"/>
</template>
</UiCell>
</view>
<UiCell class="form--item form--item__last" title="设为默认地址" >
<template slot="right-icon">
<u-switch space="2" :value="true" activeColor="#FF875B" inactiveColor="#F3F3F3" />
</template>
</UiCell>
<UiButton class="saveBtn" type="solid" size="max">保存</UiButton>
</view>
</template>
<script>
import SelectRegion from '@/components/SelectRegion.vue'
import { isPhone } from '@/common/utils/utils'
// import * as AddressApi from '@/api/address'
//
const form = {
name: '',
phone: '',
region: [],
detail: ''
}
//
const rules = {
name: [{
required: true,
message: '请输入姓名',
trigger: ['blur', 'change']
}],
phone: [{
required: true,
message: '请输入手机号',
trigger: ['blur', 'change']
}, {
//
validator: (rule, value, callback) => {
// truefalse
return isPhone(value)
},
message: '手机号码不正确',
// blurchange
trigger: ['blur'],
}],
region: [{
required: true,
message: '请选择省市区',
trigger: ['blur', 'change'],
type: 'array'
}],
detail: [{
required: true,
message: '请输入详细地址',
trigger: ['blur', 'change']
}],
}
export default {
components: {
SelectRegion
},
data() {
return {
form,
rules,
//
disabled: false
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
// onReadyonLoad
onReady() {
this.$refs.uForm.setRules(this.rules)
},
methods: {
//
handleSubmit() {
const app = this
if (app.disabled) {
return false
}
app.$refs.uForm.validate(valid => {
if (valid) {
app.disabled = true
AddressApi.add(app.form)
.then(result => {
app.$toast(result.message)
uni.navigateBack()
})
.finally(() => app.disabled = false)
}
})
}
}
}
import BsSelectCity from '../../../components/BsSelectCity.vue';
import UiButton from '../../../components/UiButton.vue';
import UiCell from '../../../components/UiCell.vue';
export default {
components: { UiCell, UiButton, BsSelectCity }
};
</script>
<style>
page {
background: #f7f8fa;
}
</style>
<style lang="scss" scoped>
.page-title {
width: 94%;
margin: 0 auto;
padding-top: 40rpx;
font-size: 28rpx;
color: rgba(69, 90, 100, 0.6);
}
.form-wrapper {
margin: 20rpx auto 20rpx auto;
padding: 0 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
}
/* 底部操作栏 */
.footer {
margin-top: 60rpx;
.btn-wrapper {
height: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.btn-item {
flex: 1;
font-size: 28rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
color: #fff;
border-radius: 50rpx;
}
.btn-item-main {
background: linear-gradient(to right, #f9211c, #ff6335);
//
&.disabled {
background: #ff9779;
}
}
}
page {
background: #f8f8f8;
}
.form{
background: #fff;
margin-bottom: 20rpx;
&--item{
padding: 0 40rpx;
&__last{
border: 0;
}
}
&--city{
padding:0 ;
}
&--itemInput{
flex: 1;
font-size: 28rpx;
padding-left: 40rpx;
}
}
.saveBtn{
position: fixed;
bottom: 89rpx;
left: 30rpx;
}
/deep/ {
.form--city .uiCell{
padding: 0 40rpx;
}
}
</style>

@ -0,0 +1,85 @@
<!--
* @Author: ch
* @Date: 2022-03-22 14:12:18
* @LastEditors: ch
* @LastEditTime: 2022-03-29 16:24:26
* @Description: file content
-->
<template>
<view class="container">
<view class="form">
<UiCell class="form--item" title="收货人" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入收货人姓名"/>
</template>
</UiCell>
<UiCell class="form--item" title="手机号码" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入收货手机号码"/>
</template>
</UiCell>
<BsSelectCity class="form--item form--city"></BsSelectCity>
<UiCell class="form--item form--item__last" title="详细地址" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" placeholder="请输入详细地址"/>
</template>
</UiCell>
</view>
<view class="form">
<UiCell class="form--item" title="设为默认地址" >
<template slot="right-icon">
<u-switch space="2" :value="true" activeColor="#FF875B" inactiveColor="#F3F3F3" />
</template>
</UiCell>
<UiCell class="form--item form--item__last delAddress" title="删除收货地址" :rightIcon="false"></UiCell>
</view>
<UiButton class="saveBtn" type="solid" size="max">保存</UiButton>
</view>
</template>
<script>
import BsSelectCity from '../../../components/BsSelectCity.vue';
import UiButton from '../../../components/UiButton.vue';
import UiCell from '../../../components/UiCell.vue';
export default {
components: { UiCell, UiButton, BsSelectCity }
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.form{
background: #fff;
margin-bottom: 20rpx;
&--item{
padding: 0 40rpx;
&__last{
border: 0;
}
}
&--city{
padding:0 ;
}
&--itemInput{
flex: 1;
font-size: 28rpx;
padding-left: 40rpx;
}
}
.saveBtn{
position: fixed;
bottom: 89rpx;
left: 30rpx;
}
/deep/ {
.delAddress .uiCell--title{
color: #FF875B;
}
.form--city .uiCell{
padding: 0 40rpx;
}
}
</style>

@ -2,317 +2,113 @@
* @Author: ch
* @Date: 2022-03-22 13:54:15
* @LastEditors: ch
* @LastEditTime: 2022-03-23 10:55:44
* @LastEditTime: 2022-03-29 16:25:49
* @Description: file content
-->
<template>
<view class="container">
<view class="addres-list">
<view class="address-item" v-for="(item, index) in list" :key="index">
<view class="contacts">
<text class="name">{{ item.name }}</text>
<text class="phone">{{ item.phone }}</text>
</view>
<view class="address">
<text class="region" v-for="(region, idx) in item.region" :key="idx">{{ region }}</text>
<text class="detail">{{ item.detail }}</text>
</view>
<view class="line"></view>
<view class="item-option">
<view class="_left">
<label class="item-radio" @click.stop="handleSetDefault(item.address_id)">
<radio class="radio" color="#fa2209" :checked="item.address_id == defaultId"></radio>
<text class="text">{{ item.address_id == defaultId ? '默认' : '选择' }}</text>
</label>
</view>
<view class="_right">
<view class="events">
<view class="event-item" @click="handleUpdate(item.address_id)">
<text class="iconfont icon-edit"></text>
<text class="title">编辑</text>
</view>
<view class="event-item" @click="handleRemove(item.address_id)">
<text class="iconfont icon-delete"></text>
<text class="title">删除</text>
</view>
</view>
</view>
</view>
</view>
</view>
<BsEmpty v-if="!list.length" :isLoading="isLoading" tips="亲,暂无收货地址" />
<!-- 底部操作按钮 -->
<view class="footer-fixed">
<view class="btn-wrapper">
<view class="btn-item btn-item-main" @click="handleCreate()"></view>
</view>
</view>
</view>
<view class="container">
<view class="address">
<BsEmpty tips="暂无收货地址呢~"></BsEmpty>
<view class="addressItem" v-for="item in 2" :key="item"
:class="{'addressItem__last' : item === 2,'addressItem__default':item == 1}">
<view>
<view class="addressItem--city">湖南省长沙市岳麓区</view>
<view class="addressItem--detail">西上海大厦芯城科技园8栋13楼</view>
<view>
<text class="addressItem--name">马老师</text>
<text>189****0000</text>
</view>
</view>
<image class="addressItem--edit" src="@/static/account/edit.png"
@click="$Router.push('/addressEdit')" />
</view>
</view>
<UiButton class="addAddress" type="solid" size="max" @click="$Router.push('/addressCreate')"></UiButton>
</view>
</template>
<script>
// import * as AddressApi from '@/api/address'
import BsEmpty from '@/components/BsEmpty'
export default {
components: {
BsEmpty
},
data() {
return {
//
options: {},
//
isLoading: true,
//
list: [],
//
defaultId: null
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//
this.options = options
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
//
this.getPageData()
},
methods: {
//
getPageData() {
const app = this
app.isLoading = true
Promise.all([app.getDefaultId(), app.getAddressList()])
.then(() => {
//
app.onReorder()
})
.finally(() => app.isLoading = false)
},
//
getAddressList() {
const app = this
return new Promise((resolve, reject) => {
app.list = []
resolve({})
// AddressApi.list()
// .then(result => {
// app.list = result.data.list
// resolve(result)
// })
// .catch(reject)
})
},
//
getDefaultId() {
return new Promise((resolve, reject) => {
const app = this
app.defaultId = null
resolve({})
// AddressApi.defaultId()
// .then(result => {
// app.defaultId = result.data.defaultId
// resolve(result)
// })
// .catch(reject)
})
},
//
onReorder() {
const app = this
app.list.sort(item => {
return item.address_id == app.defaultId ? -1 : 1
})
},
/**
* 添加新地址
*/
handleCreate() {
this.$navTo('pages/address/create')
},
/**
* 编辑地址
* @param {int} addressId 收货地址ID
*/
handleUpdate(addressId) {
this.$navTo('pages/address/update', { addressId })
},
/**
* 删除收货地址
* @param {int} addressId 收货地址ID
*/
handleRemove(addressId) {
const app = this
uni.showModal({
title: "提示",
content: "您确定要删除当前收货地址吗?",
success({ confirm }) {
confirm && app.onRemove(addressId)
}
});
},
/**
* 确认删除收货地址
* @param {int} addressId 收货地址ID
*/
onRemove(addressId) {
const app = this
// AddressApi.remove(addressId)
// .then(result => {
// app.getPageData()
// })
},
/**
* 设置为默认地址
* @param {Object} addressId
*/
handleSetDefault(addressId) {
const app = this
// AddressApi.setDefault(addressId)
// .then(result => {
// app.defaultId = addressId
// app.options.from === 'checkout' && uni.navigateBack()
// })
}
}
}
import BsEmpty from "@/components/BsEmpty";
import UiButton from '../../../components/UiButton.vue';
export default {
components: { BsEmpty, UiButton },
data() {
return {};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.addres-list {
padding-bottom: calc(constant(safe-area-inset-bottom) + 120rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
}
//
.address-item {
margin: 20rpx auto 20rpx auto;
padding: 30rpx 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
}
.contacts {
font-size: 30rpx;
margin-bottom: 16rpx;
.name {
margin-right: 16rpx;
}
}
.address {
font-size: 28rpx;
.region {
margin-right: 10rpx;
}
}
.line {
margin: 20rpx 0;
border-bottom: 1rpx solid #f3f3f3;
}
.item-option {
display: flex;
justify-content: space-between;
height: 48rpx;
//
.item-radio {
font-size: 28rpx;
.radio {
vertical-align: middle;
transform: scale(0.76)
}
.text {
vertical-align: middle;
}
}
//
.events {
display: flex;
align-items: center;
line-height: 48rpx;
.event-item {
font-size: 28rpx;
margin-right: 26rpx;
color: #4c4c4c;
&:last-child {
margin-right: 0;
}
.title {
margin-left: 8rpx;
}
}
}
}
//
.footer-fixed {
position: fixed;
bottom: var(--window-bottom);
left: 0;
right: 0;
min-height: 120rpx;
z-index: 11;
box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
background: #fff;
// ios线
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.btn-wrapper {
height: 120rpx;
display: flex;
align-items: center;
padding: 0 40rpx;
}
.btn-item {
flex: 1;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
border-radius: 50rpx;
}
.btn-item-main {
background: linear-gradient(to right, #f9211c, #ff6335);
}
}
page{
background: #f8f8f8;
}
.address{
background: #fff;
}
.addressItem{
height: 188rpx;
margin-left: 40rpx;
padding-right: 40rpx;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #999;
&--detail{
font-size: 28rpx;
color: #333;
margin: 20rpx 0;
}
&--name{
margin-right: 46rpx;
}
&--edit{
width: 26rpx;
height: 26rpx;
}
&__default .addressItem--city{
display: flex;
align-items: center;
&::after{
display: block;
content: '默认';
background: #FF512B;
color: #fff;
border-radius: 4rpx;
padding: 4rpx 6rpx;
margin-left: 20rpx;
}
}
&__last{
border: 0;
}
}
.addAddress{
position: fixed;
bottom: 89rpx;
left: 30rpx;
&::before{
display: inline-block;
content: "+";
margin-right: 20rpx;
font-size: 46rpx;
font-weight: bold;
padding-top: 10rpx;
}
}
</style>

@ -42,7 +42,7 @@
<UiCell title="退货/售后">
<image slot="icon" class="cell--icon" src="@/static/account/tk.png" />
</UiCell>
<UiCell title="收货地址">
<UiCell title="收货地址" @click="$Router.push('/addressList')">
<image slot="icon" class="cell--icon" src="@/static/common/dz.png" />
</UiCell>
<UiCell title="联系客服">

@ -2,13 +2,18 @@
* @Author: ch
* @Date: 2022-03-21 10:31:54
* @LastEditors: ch
* @LastEditTime: 2022-03-23 17:03:25
* @LastEditTime: 2022-03-29 10:45:01
* @Description: file content
-->
<template>
<view>
<view class="header">
<BsSearchTop :value="$Route.query.search"></BsSearchTop>
<UiPageHeader>
<u--input slot="custom" class="search--input" prefixIconStyle="font-size:48rpx;color:#ccc"
prefixIcon="search" placeholderClass="search--input__placeholder" clearable
:placeholder="placeholder" :value="$Route.query.search"
@focus="$Router.push('/search')"/>
</UiPageHeader>
<!-- 排序标签 -->
<Sort></Sort>
</view>
@ -17,16 +22,23 @@
</template>
<script>
import BsGoodsGroup from "@/components/BsGoodsGroup.vue";
import BsSearchTop from "@/components/BsSearchTop.vue";
import Sort from "./Sort.vue";
import Sort from "./components/Sort.vue";
import UiPageHeader from '@/components/UiPageHeader.vue';
export default {
components: { BsGoodsGroup, BsSearchTop, Sort },
components: { BsGoodsGroup, Sort, UiPageHeader },
data() {
return {
sortType: "all", //
sortPrice: false, // (true false)
};
},
mounted(){
// console.log(getCurrentPages())
},
onHide(){
console.log(getCurrentPages());
}
};
</script>
<style lang="scss" scoped>
@ -38,6 +50,18 @@ page {
top: var(--window-top);
z-index: 99;
}
.search--input{
display: block;
margin-left:20rpx;
height: 70rpx;
border:none;
box-sizing: border-box;
background: #F8F8F8;
&__placeholder{
font-size: 26rpx;
color: #666;
}
}
.goods-group {
padding-top: 30rpx;
}

@ -2,18 +2,20 @@
* @Author: ch
* @Date: 2022-03-21 11:29:38
* @LastEditors: ch
* @LastEditTime: 2022-03-23 17:18:48
* @LastEditTime: 2022-03-29 10:59:01
* @Description: file content
-->
<template>
<view class="container">
<view class="search">
<image class="search--icon" src="@/static/search/arrow.png" @click="$Router.back()"></image>
<u--input class="search--input" placeholder="请输入您想搜索的商品名称"
prefixIcon="search" clearable prefixIconStyle="font-size:48rpx;color:#ccc"
v-model="searchValue" placeholderClass="search--input__placeholder"></u--input>
<text class="search--btn" @click="onSearch"></text>
</view>
<UiPageHeader>
<view slot="custom" class="search">
<u--input class="search--input" placeholder="请输入您想搜索的商品名称"
prefixIcon="search" clearable prefixIconStyle="font-size:48rpx;color:#ccc"
v-model="searchValue" placeholderClass="search--input__placeholder"></u--input>
<text class="search--btn" @click="onSearch"></text>
</view>
</UiPageHeader>
<view class="history" v-if="historyList.length">
<view class="history--head">
<text>最近搜索</text>
@ -29,9 +31,11 @@
</template>
<script>
import UiPageHeader from '../../components/UiPageHeader.vue';
const HISTORY_SEARCH_KEY = "historySearch";
export default {
components: { UiPageHeader },
data() {
return {
historyList : [],
@ -42,6 +46,9 @@ export default {
this.searchValue = '';
this.historyList = uni.getStorageSync(HISTORY_SEARCH_KEY) || [];
},
onHide(){
// console.log(getCurrentPages());
},
methods: {
/**
@ -51,7 +58,7 @@ export default {
const { searchValue } = this;
if (searchValue) {
this.setHistory(searchValue);
this.$Router.push({path:'/pages/goods/list/index', query :{
this.$Router.push({path:'/goodsList', query :{
search: searchValue
}
});
@ -91,7 +98,7 @@ export default {
*/
handleQuick(searchValue) {
this.setHistory(searchValue);
this.$Router.push({path:'/pages/goods/list/index', query :{
this.$Router.push({path:'/goodsList', query :{
search: searchValue
}
});
@ -104,21 +111,16 @@ export default {
page{
background: #fff;
}
.container{
padding: 0 40rpx;
}
.search{
height: 88rpx;
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
&--icon{
width: 14rpx;
height: 28rpx;
}
&--input{
display: block;
margin: 0 40rpx;
margin-right: 40rpx;
height: 70rpx;
border:none;
box-sizing: border-box;
@ -140,6 +142,7 @@ page{
//
.history {
padding: 0 40rpx;
&--head {
font-size: 26rpx;
color: #666;

@ -2,21 +2,21 @@
* @Author: ch
* @Date: 2019-08-22 19:41:20
* @LastEditors: ch
* @LastEditTime: 2022-03-25 11:56:01
* @LastEditTime: 2022-03-29 14:01:10
* @Description: file content
-->
<template>
<view>
<view class="header">
<view class="logo" :class="{'logo__min' : scrollTop > 35 }"></view>
<view class="search search__min" v-if="scrollTop > 35" @click="$Router.push('/pages/goods/search')">
<view class="search search__min" v-if="scrollTop > 35" @click="$Router.push('/search')">
<text class="search--input">请输入您想搜索的商品名称</text>
</view>
<view class="msg">
<image class="msg--icon" src="@/static/index/msg.png"></image>
</view>
</view>
<view class="search" @click="$Router.push('/pages/goods/search')">
<view class="search" @click="$Router.push('/search')">
<text class="search--input">请输入您想搜索的商品名称</text>
</view>
@ -41,9 +41,9 @@
</template>
<script>
import BsGoodsGroup from '@/components/BsGoodsGroup';
import Sekill from './Sekill';
import Pick from './Pick';
import Banner from './Banner';
import Sekill from './components/Sekill';
import Pick from './components/Pick';
import Banner from './components/Banner';
import {ApiGetBannerData} from '@/common/api/index.js';
export default {
components : {BsGoodsGroup, Pick, Banner, Sekill},
@ -70,6 +70,8 @@ export default {
duration : 0
});
this.scrollTop = 0;
console.log(this.$store.state);
},
onPageScroll({scrollTop}){
if(this.scrollTop > 36 && scrollTop > 36){

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 15:36:46
* @LastEditors: ch
* @LastEditTime: 2022-03-28 18:57:15
* @LastEditTime: 2022-03-29 14:00:56
* @Description: file content
-->
<template>
@ -16,7 +16,7 @@
<input placeholder="请输入手机号" v-model="phone" class="login--input" border="bottom" />
</u-form-item>
<u-form-item class="login--code">
<input placeholder="验证码" type="number" maxlength="4" class="login--input" v-model="code" border="bottom" />
<input placeholder="验证码" type="number" maxlength="6" class="login--input" v-model="code" border="bottom" />
<u-code ref="uCode" @change="codeChange" changeText="X秒后重新获取"
@start="sendStatus = true" @end="sendStatus = false" seconds="60"></u-code>
<text class="login--send-btn" :class="sendStatus && 'login--send-btn__disabled'"
@ -85,16 +85,18 @@ export default {
uni.$u.toast('请勾选同意《用户协议》和《隐私协议》');
return false
}
const {error, resutl} = await ApiPostLogin({
const {error, result} = await ApiPostLogin({
phone : this.phone,
verificationCode : this.code,
source : 0
source : 1
});
if(error){
uni.$u.toast(error.message);
return false;
}
this.$Router.back();
this.$store.commit('SET_TOKEN',result.token);
const pagesLength = getCurrentPages().length;
pagesLength > 1 ? this.$Router.back() : this.$Router.replace('/');
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Loading…
Cancel
Save