Merge remote-tracking branch 'origin/master'

This commit is contained in:
kino 2021-01-16 11:54:52 +08:00
commit 33854eb36e
13 changed files with 631 additions and 30 deletions

View File

@ -113,6 +113,13 @@
"pathName": "pages/winery/winery-detail",
"query": "",
"scene": null
},
{
"id": 9,
"name": "地址管理",
"pathName": "pages/mall/user/user-address",
"query": "",
"scene": null
}
]
}

View File

@ -31,6 +31,7 @@
margin-top: 10px;
}
.boom {
background-color: #F0F1F2;
width: 100%;
@ -101,7 +102,9 @@ pages: [
'pages/form6',
'pages/mall/index',
'pages/mall/goods-detail',
'pages/mall/user/user-address',
'pages/winery/winery-detail'
],
navigateToMiniProgramAppIdList: [
'wx88736d7d39e2eda6'
@ -143,7 +146,8 @@ usingComponents: {
"van-grid-item": "./vant/grid-item/index",
"van-dialog": "./vant/dialog/index",
"van-image": "./vant/image/index",
"van-loading": "./vant/loading/index"
"van-loading": "./vant/loading/index",
"van-area": "./vant/area/index"
}
}
</config>

View File

@ -1,9 +1,10 @@
import store from '@/store'
import eventHub from './common/eventHub'
class AppManager {
saveOpenid(openid) {
wx.setStorageSync('openid', openid)
store.dispatch('setOpenidAction', openid)
}
@ -12,6 +13,16 @@ class AppManager {
}
navigateTo(url) {
if (!store.state.user.token) {
eventHub.$emit('onShowDialogUserInfo')
return
}
if (!url) {
this.showToast('建设中')
return
}
wx.navigateTo({
url: url
})

View File

@ -140,7 +140,7 @@
</div>
<span v-if="columnRecord.length > 0" style="margin:15px 0;font-weight: bold;">热门活动</span>
<span style="margin:15px 0;font-weight: bold;">热门活动</span>
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER.image" />
@ -169,7 +169,7 @@ import defaultMix from '../../../mixins/defaultMix'
wepy.component({
store,
hooks: {},
mixins: [defaultMix],
data: {
columnRecord: [
{
@ -180,6 +180,8 @@ wepy.component({
]
},
mixins: [defaultMix],
computed: {
...mapState({
'imageDefine': state => state.imageDefine,

View File

@ -1,38 +1,142 @@
<style lang="less">
.header {
.header-image {
width: 100%;
height: 536rpx;
z-index: -10;
height: 200px;
z-index: -1;
position: absolute;
top: 0;
}
.user-info {
margin-top: 100px;
margin-left: 20px;
margin-right: 20px;
display: flex;
}
.user-info-msg {
display: flex;
flex-direction: column;
margin-left: 10px;
justify-content: center;
color: white;
}
.header-grid-body-top {
padding: 20px;
border: transparent 1px solid;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
width: 660rpx;
margin-top: 20px;
box-shadow: 4px 4px 10px #eeeeee;
background-color: orange;
}
.header-grid-body-bottom {
border: transparent 1px solid;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
width: 660rpx;
background-color: #ffffff;
box-shadow: 4px 4px 10px #eeeeee;
padding: 10px 10px 0px 10px;
font-weight: bold;
}
.grid-body {
border: #fff 1px solid;
border-radius: 20px;
width: 660rpx;
margin-top: 20px;
background-color: white;
box-shadow: 4px 4px 10px #eeeeee;
padding: 10px 10px 0px 10px;
font-weight: bold;
}
</style>
<template>
<div>my</div>
<image class="header-image" :src="imageDefine.HOME_TITLE_IMAGE" />
<div class="container" style="margin: 10px;">
<div class="user-info">
<van-image round width="120rpx" height="120rpx" :src="user.userInfo.avatar" />
<div class="user-info-msg">
<span style="font-size: 18px;">{{user.mobile}}</span>
<span style="font-size: 12px;">{{user.userInfo.nickName}}</span>
</div>
</div>
<div class="header-grid-body-top">
<div style="display: flex;">
<span>{{user.userInfo.nickName}} </span>
<van-tag round type="primary">标签</van-tag>
</div>
</div>
<div class="header-grid-body-bottom">
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
<span style="margin-top: 10px;">{{item.name}} </span>
</van-grid-item>
</van-grid>
</div>
<div class="grid-body">
<span style="margin:25px 10px 15px 10px;font-weight: bold;">常用功能</span>
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
<span style="margin-top: 10px;">{{item.name}} </span>
</van-grid-item>
</van-grid>
</div>
<div class="grid-body">
<span style="margin:25px 10px 15px 10px;font-weight: bold;">更多推荐</span>
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
<span style="margin-top: 10px;">{{item.name}} </span>
</van-grid-item>
</van-grid>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions } from '@wepy/x'
import { mapActions, mapState } from '@wepy/x'
import defaultMix from '../../../mixins/defaultMix'
wepy.component({
store,
hooks: {
},
hooks: {},
data: {
active: 0
},
mixins: [defaultMix],
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'user': state => state.user,
'navDefine': state => state.navDefine
})
},
methods: {
},
methods: {},
ready() {
}

View File

@ -8,7 +8,7 @@ export default {
onNavItem (item) {
console.log(item)
// appManager.navigateTo(item.path)
appManager.navigateTo(item.path)
},
navBack() {
wx.navigateBack()

View File

@ -134,7 +134,8 @@ wepy.page({
wx.getUserInfo({
success(res) {
self.setUserAction({
console.log(res)
self.setOpenid({
openid: appManager.getOpenid(),
userInfo: res.userInfo
})

View File

@ -89,12 +89,11 @@ module.exports.getTime = getTime;
我的
</van-tabbar-item>
</van-tabbar>
<mall-home v-if="pageIndex === 0" />
<mall-home v-if="pageIndex === 3" />
<mall-shopping v-else-if="pageIndex === 1" />
<mall-bbs v-else-if="pageIndex === 2" />
<mall-my v-else-if="pageIndex === 3" />
<mall-my v-else-if="pageIndex === 0" />
<dialog-registration />
<van-button @tap="onTest">测试</van-button>
</template>
@ -120,7 +119,7 @@ wepy.page({
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'userInfo': state => state.user.userInfo
'user': state => state.user
})
},
@ -130,9 +129,6 @@ wepy.page({
'setTokenAction',
'setOpenidAction'
]),
onTest() {
eventHub.$emit('onShowDialogUserInfo')
},
handleViewTap() {
console.log('handleVieTap clicked')
},
@ -140,6 +136,10 @@ wepy.page({
},
onChange(event) {
if (!this.user.token) {
eventHub.$emit('onShowDialogUserInfo')
return
}
this.pageIndex = event.$wx.detail
},
callAppLaunch() {

View File

@ -0,0 +1,224 @@
<style lang="less">
.address-item {
border: #fff 1px solid;
border-radius: 20px;
width: 660rpx;
margin-top: 20px;
background-color: white;
box-shadow: 4px 4px 10px #eeeeee;
padding: 10px 10px 0px 10px;
font-weight: bold;
display: flex;
flex-direction: column;
//align-items: center;
}
input {
margin: 12px 15px;
font-size: 14px;
}
.cell-title {
padding: 10px 16px;
font-weight: bold;
}
.cell {
margin-top: 10px;
}
.cell-input {
display: flex;
justify-content: space-between;
margin-right: 15px;
}
.cell-item {
margin-left: 22px;
margin-top: 12px;
width: 300rpx;
}
</style>
<template>
<nav-bar :title="title" />
<div class="container">
<div class="address-item">
<div class="cell">
<span class="cell-title">选择收货地区</span>
<radio-group bindchange="onChangeCountry" style="display: flex;">
<div class="cell-item" v-for="(item,index) in countryTypes">
<radio :value="item" :checked="item === radio" color="#AC3016">{{item}}</radio>
<span>{{item}} </span>
</div>
</radio-group>
<van-divider customStyle="margin: 10px 5px;" />
</div>
<div v-if="radio=== '国内'" class="cell">
<span class="cell-title">收货地址(省市区)</span>
<div style="display: flex;width: 100%;">
<picker mode="region" v-model="form.region" bindchange="bindRegionChange" style="width: 700rpx;">
<van-field
:value="form.region"
required
center
clearable
readonly
placeholder="请选择"
border="{{ false }}"
/>
</picker>
<van-icon name="arrow" color="#dddddd" />
</div>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">详细地址</span>
<van-field
:value="form.address"
required
center
clearable
type="textarea"
autosize
placeholder="请输入详细地址"
bind:change="onChangeAddress"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">收货人手机号码</span>
<van-field
:value="form.mobile"
required
center
clearable
type="number"
placeholder="请输入手机联系电话号码"
bind:change="onChangeMobile"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">收货人姓名</span>
<van-field
:value="form.name"
required
center
clearable
placeholder="请输入收货人姓名"
bind:change="onChangeName"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<van-button round type="info" size="large" style="margin: 20px;" @tap="onSubmit">保存</van-button>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions, mapState } from '@wepy/x'
import defaultMix from '../../../mixins/defaultMix'
import appManager from '../../../appManager'
wepy.page({
store,
hooks: {},
data: {
title: '添加地址',
countryTypes: ['国内', '海外'],
form: {
region: ['宁夏回族自治区', '银川市', '西夏区'],
address: '',
mobile: '',
name: ''
},
radio: '国内'
},
mixins: [defaultMix],
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'user': state => state.user,
'navDefine': state => state.navDefine,
'userAddress': state => state.userAddress
})
},
methods: {
bindRegionChange(e) {
this.form.region = e.$wx.detail.value
},
onChangeCountry(e) {
this.radio = e.$wx.detail.value
if (this.radio === '海外') {
this.form.region = ['海外']
} else {
this.form.region = ['宁夏回族自治区', '银川市', '西夏区']
}
},
onSubmit() {
console.log(this.form)
if (this.form.region.length < 1) {
appManager.showToast('请选择收货地区!')
return
}
if (!this.form.address) {
appManager.showToast('请输入收货详细地址!')
return
}
if (!this.form.mobile) {
appManager.showToast('请输入收货人手机号码!')
return
}
if (!this.form.name) {
appManager.showToast('请输入收货人姓名!')
return
}
// TODO 提交
this.navBack()
},
onChangeAddress(e) {
this.form.address = e.$wx.detail
},
onChangeMobile(e) {
this.form.mobile = e.$wx.detail
},
onChangeName(e) {
this.form.name = e.$wx.detail
}
},
ready() {
this.form.mobile = this.user.mobile
}
})
</script>
<config>
{
navigationBarTitleText: ''
}
</config>

View File

@ -0,0 +1,230 @@
<style lang="less">
.address-item {
border: #fff 1px solid;
border-radius: 20px;
width: 660rpx;
margin-top: 20px;
background-color: white;
box-shadow: 4px 4px 10px #eeeeee;
padding: 10px 10px 0px 10px;
font-weight: bold;
display: flex;
flex-direction: column;
//align-items: center;
}
input {
margin: 12px 15px;
font-size: 14px;
}
.cell-title {
padding: 10px 16px;
font-weight: bold;
}
.cell {
margin-top: 10px;
}
.cell-input {
display: flex;
justify-content: space-between;
margin-right: 15px;
}
.cell-item {
margin-left: 22px;
margin-top: 12px;
width: 300rpx;
}
</style>
<template>
<nav-bar :title="title" />
<div class="container">
<div class="address-item">
<div class="cell">
<span class="cell-title">选择收货地区</span>
<radio-group bindchange="onChangeCountry" style="display: flex;">
<div class="cell-item" v-for="(item,index) in countryTypes">
<radio :value="item" :checked="item === radio" color="#AC3016">{{item}}</radio>
<span>{{item}} </span>
</div>
</radio-group>
<van-divider customStyle="margin: 10px 5px;" />
</div>
<div v-if="radio=== '国内'" class="cell">
<span class="cell-title">收货地址(省市区)</span>
<div style="display: flex;width: 100%;">
<picker mode="region" v-model="form.region" bindchange="bindRegionChange" style="width: 700rpx;">
<van-field
:value="form.region"
required
center
clearable
readonly
placeholder="请选择"
border="{{ false }}"
/>
</picker>
<van-icon name="arrow" color="#dddddd" />
</div>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">详细地址</span>
<van-field
:value="form.address"
required
center
clearable
type="textarea"
autosize
placeholder="请输入详细地址"
bind:change="onChangeAddress"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">收货人手机号码</span>
<van-field
:value="form.mobile"
required
center
clearable
type="number"
placeholder="请输入手机联系电话号码"
bind:change="onChangeMobile"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<div class="cell">
<span class="cell-title">收货人姓名</span>
<van-field
:value="form.name"
required
center
clearable
placeholder="请输入收货人姓名"
bind:change="onChangeName"
/>
<van-divider customStyle="margin: 0 5px;" />
</div>
<van-button round type="info" size="large" style="margin: 20px;" @tap="onSubmit">保存</van-button>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions, mapState } from '@wepy/x'
import defaultMix from '../../../mixins/defaultMix'
import appManager from '../../../appManager'
wepy.page({
store,
hooks: {},
data: {
title: '添加地址',
countryTypes: ['国内', '海外'],
form: {
region: ['宁夏回族自治区', '银川市', '西夏区'],
address: '',
mobile: '',
name: ''
},
radio: '国内'
},
mixins: [defaultMix],
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'user': state => state.user,
'navDefine': state => state.navDefine,
'userAddress': state => state.userAddress
})
},
methods: {
bindRegionChange(e) {
this.form.region = e.$wx.detail.value
},
onChangeCountry(e) {
this.radio = e.$wx.detail.value
if (this.radio === '海外') {
this.form.region = ['海外']
} else {
this.form.region = ['宁夏回族自治区', '银川市', '西夏区']
}
},
onSubmit() {
console.log(this.form)
if (this.form.region.length < 1) {
appManager.showToast('请选择收货地区!')
return
}
if (!this.form.address) {
appManager.showToast('请输入收货详细地址!')
return
}
if (!this.form.mobile) {
appManager.showToast('请输入收货人手机号码!')
return
}
if (!(/^1[3|4|5|6|8][0-9]\d{4,8}$/.test(this.form.mobile))){
appManager.showToast('请输入正确的手机号码!')
return
}
if (!this.form.name) {
appManager.showToast('请输入收货人姓名!')
return
}
// TODO 提交
this.navBack()
},
onChangeAddress(e) {
this.form.address = e.$wx.detail
},
onChangeMobile(e) {
this.form.mobile = e.$wx.detail
},
onChangeName(e) {
this.form.name = e.$wx.detail
}
},
ready() {
this.form.mobile = this.user.mobile
}
})
</script>
<config>
{
navigationBarTitleText: ''
}
</config>

View File

@ -0,0 +1,13 @@
export const userAddress = {
records: [
{
id: '1',
name: '贺兰神',
region: [],
detail: '森林公园XXXXXXXXXX'
}
]
}

View File

@ -3,12 +3,13 @@ import { wineryForm } from './wineryForm'
import { imageDefine } from './constant/imageDefine'
import { navDefine } from './constant/navDefine'
import { wineryDefine } from './constant/wineryDefine'
import { userAddress } from './constant/userAddress'
export default new Vuex.Store({
state: {
user: {
openid: '',
mobile: '',
mobile: '15595184707',
userInfo: {
nickName: '未注册用户',
avatar: 'https://img.yzcdn.cn/vant/cat.jpeg'
@ -19,7 +20,8 @@ export default new Vuex.Store({
wineryForm,
imageDefine,
navDefine,
wineryDefine
wineryDefine,
userAddress
},
mutations: {
@ -50,12 +52,15 @@ export default new Vuex.Store({
commit('setUser', user)
},
setOpenidAction({ commit }, openid) {
wx.setStorageSync('openid', openid)
commit('setOpenid', openid)
},
setMobileAction({ commit }, user) {
commit('setMobile', user)
setMobileAction({ commit }, mobile) {
wx.setStorageSync('mobile', mobile)
commit('setMobile', mobile)
},
setUserInfoAction({ commit }, userInfo) {
wx.setStorageSync('userInfo', userInfo)
commit('setUserInfo', userInfo)
},
setTokenAction({ commit }, token) {

View File

@ -63,7 +63,7 @@ public class SecurityUtils {
public static boolean matchesPassword(String rawPassword, String encodedPassword) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.matches(rawPassword, encodedPassword);
}
}o
/**
* 是否为管理员