Browse Source

上传

master
前端-胡立永 8 months ago
parent
commit
1db40f9c48
12 changed files with 186 additions and 148 deletions
  1. +17
    -2
      api/api.js
  2. +9
    -9
      components/base/navbar.vue
  3. +116
    -0
      components/config/customerServicePopup.vue
  4. +2
    -2
      config.js
  5. +2
    -1
      pages.json
  6. +15
    -112
      pages/index/center.vue
  7. +7
    -0
      pages/index/index.vue
  8. +2
    -2
      pages_order/auth/wxUserInfo.vue
  9. +2
    -7
      pages_order/components/commodity/commoditySelect.vue
  10. +4
    -1
      pages_order/mine/lease.vue
  11. +3
    -5
      pages_order/order/refundsOrExchange.vue
  12. +7
    -7
      store/store.js

+ 17
- 2
api/api.js View File

@ -151,12 +151,27 @@ const config = {
// 修改个人信息接口
updateInfo: {
url: '/info/updateInfo',
url: '/user/edit',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
// 获取用户信息
getInfo: {
url: '/user/info',
method: 'GET',
auth: true,
showLoading : true,
},
// 获取我的租赁
getLeasePage: {
url: '/user/lease/page',
method: 'POST',
showLoading : true,
},
}
@ -192,7 +207,7 @@ export function api(key, data, callback, loadingTitle) {
if (req.auth) {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages/login/mobile'
url: '/pages_order/auth/wxLogin'
})
console.error('需要登录')
return


+ 9
- 9
components/base/navbar.vue View File

@ -1,6 +1,6 @@
<template>
<view class="navbar"
:style="{backgroundColor : bgColor}">
<!-- <view class="navbar"
:style="{backgroundColor : bgColor}"> -->
<view class="title"
:style="{backgroundColor : bgColor}">
<view class="left">
@ -34,7 +34,7 @@
</view>
</view>
</view>
<!-- </view> -->
</template>
<script>
@ -81,13 +81,13 @@
<style lang="scss" scoped>
.navbar{
width: 100%;
height: 120rpx;
padding-top: var(--status-bar-height);
}
// .navbar{
// width: 100%;
// height: 120rpx;
// padding-top: var(--status-bar-height);
// }
.title{
position: fixed;
position: sticky;
top: 0;
left: 0;
padding-top: calc(var(--status-bar-height) + 20rpx);


+ 116
- 0
components/config/customerServicePopup.vue View File

@ -0,0 +1,116 @@
<template>
<!-- 联系客服弹框 -->
<uv-overlay :show="show" @click="close">
<view class="warp">
<view class="rect" @tap.stop>
<view class="title">联系客服</view>
<view class="center">确定拨打客服电话?</view>
<view class="bottom">
<view>
<uv-button type="info" shape="circle" text="取消" :custom-style="customStyle1"
@click="close"></uv-button>
</view>
<view>
<uv-button type="info" shape="circle" text="确定" :custom-style="customStyle2"
@click="confirm"></uv-button>
</view>
</view>
</view>
</view>
</uv-overlay>
</template>
<script>
export default {
data() {
return {
show: false,
}
},
computed: {
customStyle1() {
return {
height: '60rpx',
background: '#FFF',
color: '#000000',
fontSize: '36rpx',
borderRadius: '40rpx', //
// nvue
'border-top-right-radius': '40rpx',
'border-bottom-left-radius': '40rpx',
'border-bottom-right-radius': '40rpx',
'width': '150rpx',
}
},
customStyle2() {
return {
height: '60rpx',
background: '#fd5100',
color: '#FFF',
fontSize: '34px',
borderRadius: '40rpx', //
// nvue
'border-top-right-radius': '40rpx',
'border-bottom-left-radius': '40rpx',
'border-bottom-right-radius': '40rpx',
'width': '150rpx',
}
}
},
methods: {
open(){
this.show = true
},
close(){
this.show = false
},
confirm() {
this.show = false
},
}
}
</script>
<style scoped lang="scss">
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 600rpx;
height: 300rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.title {
padding: 10rpx 0 0 15rpx;
background-color: #fd5100;
color: #FFF;
text-align: left;
width: 100%;
height: 18%;
font-size: 36rpx;
}
.center {
height: 40%;
display: flex;
justify-content: center;
align-items: center;
font-size: 36rpx;
}
.bottom {
display: flex;
justify-content: center;
gap: 50rpx;
}
}
</style>

+ 2
- 2
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
@ -16,7 +16,7 @@ const config = {
baseUrl : 'http://dev.java996.icu/hotel',
},
prod : {
baseUrl : 'http://dev.java996.icu/hotel',
baseUrl : 'https://hotel.java996.icu/hotel',
}
}


+ 2
- 1
pages.json View File

@ -2,7 +2,8 @@
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"enablePullDownRefresh" : true
}
},
{


+ 15
- 112
pages/index/center.vue View File

@ -9,7 +9,7 @@
</view>
<view class="info">
<view class="name">
微信用户
{{ userInfo.nickName || '微信用户' }}
</view>
<!-- <view class="vip">
VIP1
@ -54,7 +54,7 @@
<image src="/static/image/center/1.png" mode=""></image>
</view>
<view class="">
余额3000
余额 {{ userInfo.balance || 0 }}
</view>
</view>
<view class="item">
@ -62,7 +62,7 @@
<image src="/static/image/center/4.png" mode=""></image>
</view>
<view class="">
押金30000
押金{{ userInfo.deposit || 0 }}
</view>
</view>
</view>
@ -96,7 +96,7 @@
<view class="line grid">
<uv-grid :col="4" :border="false">
<uv-grid-item @click="contactUs">
<uv-grid-item @click="$refs.customerServicePopup.open()">
<image class="image" src="/static/image/center/9.png" mode=""></image>
<text class="grid-text">联系客服</text>
</uv-grid-item>
@ -119,83 +119,39 @@
</uv-grid>
</view>
</view>
<!-- 联系客服弹框 -->
<uv-overlay :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop>
<view class="title">联系客服</view>
<view class="center">确定拨打客服电话?</view>
<view class="bottom">
<view>
<uv-button type="info" shape="circle" text="取消" :custom-style="customStyle1"
@click="cancle"></uv-button>
</view>
<view>
<uv-button type="info" shape="circle" text="确定" :custom-style="customStyle2"
@click="confirm"></uv-button>
</view>
</view>
</view>
</view>
</uv-overlay>
<customerServicePopup ref="customerServicePopup"/>
<tabber select="4" />
</view>
</template>
<script>
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import tabber from '@/components/base/tabbar.vue'
import {
mapGetters
mapGetters,
mapState,
} from 'vuex'
import userShopCommission from '@/components/userShop/userShopCommission.vue'
export default {
components: {
tabber,
userShopCommission,
customerServicePopup,
},
computed: {
...mapGetters(['userShop']),
customStyle1() {
return {
height: '60rpx',
background: '#FFF',
color: '#000000',
fontSize: '36rpx',
borderRadius: '40rpx', //
// nvue
'border-top-right-radius': '40rpx',
'border-bottom-left-radius': '40rpx',
'border-bottom-right-radius': '40rpx',
'width': '150rpx',
}
},
customStyle2() {
return {
height: '60rpx',
background: '#fd5100',
color: '#FFF',
fontSize: '34px',
borderRadius: '40rpx', //
// nvue
'border-top-right-radius': '40rpx',
'border-bottom-left-radius': '40rpx',
'border-bottom-right-radius': '40rpx',
'width': '150rpx',
}
}
...mapState(['userInfo']),
},
data() {
return {
show: false,
}
},
onShow() {
this.$store.commit('getUserInfo')
},
methods: {
headBtn() {
let self = this
uni.showModal({
@ -208,19 +164,6 @@
})
},
//
contactUs() {
this.show = true
},
confirm() {
this.show = false
},
cancle() {
this.show = false
},
}
}
</script>
@ -228,49 +171,9 @@
<style scoped lang="scss">
.page {
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 600rpx;
height: 300rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.title {
padding: 10rpx 0 0 15rpx;
background-color: #fd5100;
color: #FFF;
text-align: left;
width: 100%;
height: 18%;
font-size: 36rpx;
}
.center {
height: 40%;
display: flex;
justify-content: center;
align-items: center;
font-size: 36rpx;
}
.bottom {
display: flex;
justify-content: center;
gap: 50rpx;
}
}
}
image {
width: 100%;
height: 100%;


+ 7
- 0
pages/index/index.vue View File

@ -148,6 +148,12 @@
this.noticeList()
this.banner()
},
//
onPullDownRefresh(){
this.getGoodsPage()
this.noticeList()
this.banner()
},
//
onReachBottom() {
if(this.queryParams.pageSize < this.productList.total){
@ -175,6 +181,7 @@
},
getGoodsPage(){
this.$api('goodsPage', this.queryParams, res => {
uni.stopPullDownRefresh()
if(res.code == 200){
this.productList = res.result
}


+ 2
- 2
pages_order/auth/wxUserInfo.vue View File

@ -74,9 +74,9 @@
return
}
self.$api('infoUpdateInfo', self.userInfo, res => {
self.$api('updateInfo', self.userInfo, res => {
if (res.code == 200) {
uni.switchTab({
uni.redirectTo({
url:'/pages/index/index'
})
}


+ 2
- 7
pages_order/components/commodity/commoditySelect.vue View File

@ -61,18 +61,13 @@
selectSp(e) {
this.$emit('selectSp', e)
},
//
//
getList() {
return new Promise((success, fail) => {
this.$api('addressPage', this.queryParams, res => {
this.$api('getLeasePage', this.queryParams, res => {
if (res.code == 200) {
this.commodityList = res.result.records || [];
this.total = res.result.total || 0;
this.commodityList.forEach(n => { //
if (n.defaultFlag == 1) {
this.selectAddress = n.id
}
})
success(res.result)
}
})


+ 4
- 1
pages_order/mine/lease.vue View File

@ -1,7 +1,7 @@
<template>
<view class="page">
<navbar title="我的租赁" leftClick @leftClick="$utils.navigateBack" />
<commoditySelect/>
<commoditySelect ref="commoditySelect"/>
</view>
</template>
@ -16,6 +16,9 @@
}
},
onShow() {
this.$refs.commoditySelect.getList()
},
methods: {
}


+ 3
- 5
pages_order/order/refundsOrExchange.vue View File

@ -83,7 +83,7 @@
<!--商品选择-->
<uv-popup ref="spPopup" :round="30">
<commoditySelect height="60vh" @selectSp="selectCommodity" />
<commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect"/>
</uv-popup>
</view>
@ -120,13 +120,11 @@
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
}
},
mounted() {
onShow() {
this.$refs.commoditySelect.getList()
},
methods: {


+ 7
- 7
store/store.js View File

@ -67,19 +67,19 @@ const store = new Vuex.Store({
state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token)
// if(!state.userInfo.nickName || !state.userInfo.headImage){
// uni.navigateTo({
// url: '/pages_order/auth/wxUserInfo'
// })
// }else{
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
})
}else{
uni.navigateBack(-1)
// }
}
})
}
})
},
getUserInfo(state){
api('infoGetInfo', res => {
api('getInfo', res => {
if(res.code == 200){
state.userInfo = res.result
}


Loading…
Cancel
Save