Commit 5c27c749 by zhangzhen

功能细节优化

parent a46da194
...@@ -67,7 +67,6 @@ http.interceptor.response = (config) => { ...@@ -67,7 +67,6 @@ http.interceptor.response = (config) => {
/\/consumer\/info/g, /\/consumer\/info/g,
/\/consumer\/edit/g, /\/consumer\/edit/g,
/\/order\/creat/g, /\/order\/creat/g,
/\/order\/list/g,
/\/consumerCoupon\/list/g, /\/consumerCoupon\/list/g,
/\/consumerCoupon\/query/g, /\/consumerCoupon\/query/g,
/\/chessCards\/consumeByUser/g /\/chessCards\/consumeByUser/g
......
<template>
<view v-if="!show" class="no-login">
<view class="img-box">
<text class="cuIcon-peoplefill text-xxl text-gray"></text>
</view>
<view class="tip">
<text>您还未登录,点击</text>
<button class="cu-btn bg-pink radius margin-top">登录</button>
</view>
</view>
</template>
<script>
export default {
name:"noLogin",
props:{
value:{
type:Boolean,
default:true
}
},
data() {
return {
show:this.value
};
},
watch:{
value(val){
this.show = val
}
}
}
</script>
<style lang="scss" scoped>
.no-login{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 50vh;
.img-box{
display: flex;
justify-content: center;
align-items: center;
height: 120upx;
width: 100%;
}
.tip{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
}
}
</style>
\ No newline at end of file
const CONFIG = { const CONFIG = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'http://192.168.43.242:8211/static', // 静态资源路径 assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
baseUrl: 'http://192.168.43.21:8883/front-api', // 后台接口请求地址 baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
hostUrl: 'http://192.168.43.21:8882', // H5地址(前端运行地址) hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址 // baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址) // hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
...@@ -13,9 +13,9 @@ const CONFIG = { ...@@ -13,9 +13,9 @@ const CONFIG = {
}, },
// 生产环境配置 // 生产环境配置
production: { production: {
assetsPath: '/static', // 静态资源路径 assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
baseUrl: '', // 后台接口请求地址 baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
hostUrl: '', // H5地址(前端运行地址) hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid weixinAppId: '', // 微信公众号appid
codeHeadUrl:"", codeHeadUrl:"",
......
{ {
"name" : "clearCar", "name" : "gxpt_wechat",
"appid" : "__UNI__2B9DF18", "appid" : "__UNI__2B9DF18",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
...@@ -87,5 +87,6 @@ ...@@ -87,5 +87,6 @@
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion" : "2" "vueVersion" : "2",
"locale" : "zh-Hans"
} }
...@@ -90,6 +90,22 @@ ...@@ -90,6 +90,22 @@
</view> </view>
</scroll-view> </scroll-view>
<ToolBox v-model="show" /> <ToolBox v-model="show" />
<uni-popup ref="popup" type="center">
<view class="flex-col location-box">
<view class="flex-col content-box">
<view class="title">
<text class="text-black text-xl text-bold">提示</text>
</view>
<view class="content">
<text class="text-black text-lg">定位已关闭,请开启定位,获取最近的门店信息</text>
</view>
</view>
<view class="flex-between btn-box">
<button class="cu-btn round bg-white block" @tap="onClose">关闭</button>
<button class="cu-btn round bg-pink block" @tap="onNavToSet">去设置</button>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
...@@ -199,9 +215,7 @@ ...@@ -199,9 +215,7 @@
}, },
onLoad(option) { onLoad(option) {
console.log(option, 909090)
this.onGetDicts() this.onGetDicts()
}, },
methods: { methods: {
onGetDicts() { onGetDicts() {
...@@ -212,7 +226,6 @@ ...@@ -212,7 +226,6 @@
this.onLoading() this.onLoading()
} else { } else {
dictList().then(res => { dictList().then(res => {
console.log(res, "获取字典")
dicts = res.data.data; dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data)) uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.facilitieList = getDictItem(dicts, "indoor_facilities"); this.facilitieList = getDictItem(dicts, "indoor_facilities");
...@@ -224,6 +237,11 @@ ...@@ -224,6 +237,11 @@
uni.showLoading({ uni.showLoading({
title: "加载中..." title: "加载中..."
}) })
uni.getSetting({
complete: (res) => {
console.log(res,909090)
if(res.authSetting['scope.userLocation']){
console.log("打开了定位设置")
uni.getLocation({ uni.getLocation({
type: "gcj02", type: "gcj02",
success: (result) => { success: (result) => {
...@@ -253,6 +271,13 @@ ...@@ -253,6 +271,13 @@
this.onGetListStore() this.onGetListStore()
} }
}) })
} else{
uni.hideLoading()
this.$refs.popup.open()
}
}
})
}, },
onGetListStore() { onGetListStore() {
getListStore({ getListStore({
...@@ -276,8 +301,6 @@ ...@@ -276,8 +301,6 @@
} }
}) })
} }
console.log(this.storeInfo, 909090)
} }
}) })
}, },
...@@ -349,7 +372,19 @@ ...@@ -349,7 +372,19 @@
if (!this.show) { if (!this.show) {
this.show = true this.show = true
} }
},
onClose(){
this.$refs.popup.close()
},
onNavToSet(){
uni.openSetting({
scope:"scope.userLocation",
complete: (res) => {
console.log(res,909090)
this.onClose();
this.onLoading()
}
})
} }
}, },
} }
...@@ -567,20 +602,18 @@ ...@@ -567,20 +602,18 @@
.part-top { .part-top {
position: relative; position: relative;
width: 600upx; width: 600upx;
min-height: 300upx; height: 300upx;
z-index: 10; z-index: 10;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 36upx 36upx 36upx 36upx; border-radius: 36upx 36upx 36upx 36upx;
box-shadow: 0 0 4upx rgba(0, 0, 0, 0.3); box-shadow: 0 0 4upx rgba(0, 0, 0, 0.3);
overflow: hidden; overflow: hidden;
.room-img { .room-img {
display: block;
width: 100%; width: 100%;
border-radius: 36upx 36upx 36upx 36upx;
height: 100%; height: 100%;
} border-radius: 36upx 36upx 36upx 36upx;
}
.part-top-content { .part-top-content {
.flex-between { .flex-between {
padding: 12upx 4upx; padding: 12upx 4upx;
...@@ -705,4 +738,42 @@ ...@@ -705,4 +738,42 @@
flex-wrap: wrap; flex-wrap: wrap;
padding: 12upx 20upx; padding: 12upx 20upx;
} }
.location-box{
display: flex;
flex-direction: column;
width: 100%;
min-height: 600upx;
.content-box{
display: flex;
flex-direction: column;
width: 90%;
background-color: #ffffff;
border: 1px solid #B70469;
border-radius: 20upx;
margin: 0 auto 40upx;
.title{
display: flex;
justify-content: center;
align-items: center;
padding: 30upx 0;
border-bottom: 1px solid #B70469;
}
.content{
display: flex;
justify-content: center;
align-items: center;
padding: 30upx;
min-height: 300upx;
}
}
.btn-box{
display: flex;
justify-content: space-between;
width: 84%;
margin: 0 auto;
.cu-btn{
width: 40%;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
<view class="user-action"> <view class="user-action">
<view v-for="(item,k) in userAction" :key="k" class="action-box"> <view v-for="(item,k) in userAction" :key="k" class="action-box">
<view v-if="item.show" class="action-item" @tap="onActionNav(item,k)"> <view v-if="item.show|| userInfo.roleType =='2'" class="action-item" @tap="onActionNav(item,k)">
<view class="img-box"> <view class="img-box">
<image :src="item.iconUrl" mode="widthFix"></image> <image :src="item.iconUrl" mode="widthFix"></image>
</view> </view>
...@@ -111,19 +111,19 @@ ...@@ -111,19 +111,19 @@
type:"", type:"",
show:true show:true
}, },
{ // {
label:"立即充值", // label:"立即充值",
iconUrl:config.assetsPath+'/vip_icon.png', // iconUrl:config.assetsPath+'/vip_icon.png',
routePath:"", // routePath:"",
type:"", // type:"",
show:true // show:true
}, // },
{ {
label:"保洁管理", label:"保洁管理",
iconUrl:config.assetsPath+'/clean_icon.png', iconUrl:config.assetsPath+'/clean_icon.png',
routePath:"/pages/cleanManage/cleanManage", routePath:"/pages/cleanManage/cleanManage",
type:"", type:"",
show:true show:false
} }
] ]
} }
......
<template> <template>
<view class="order-record"> <view class="order-record">
<scroll-view scroll-x class="bg-white nav"> <scroll-view v-if="loginStatus" scroll-x class="bg-white nav">
<view class="flex text-center"> <view class="flex text-center">
<view class="cu-item flex-sub" :class="index==statusIndex?'text-orange cur':''" <view class="cu-item flex-sub" :class="index==statusIndex?'text-orange cur':''"
v-for="(item,index) in statusList" :key="index" @tap="tabSelect" :data-id="index"> v-for="(item,index) in statusList" :key="index" @tap="tabSelect(index)">
<text>{{item.label}}</text> <text>{{item.label}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="content-box"> <view v-if="loginStatus" class="content-box">
<view class="list-content"> <view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1"> <view class="flex-between part-1">
...@@ -43,11 +43,12 @@ ...@@ -43,11 +43,12 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="list.length == 0" text="未查询到相关订单" textColor='#C1C1C1'></u-empty> <u-empty v-if="loginStatus && list.length == 0" text="未查询到相关订单" textColor='#C1C1C1'></u-empty>
<view v-if="list.length" style="padding: 12px 6% 0;"> <view v-if="loginStatus && list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText" <u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" /> :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view> </view>
<NoLogin v-model="loginStatus" />
</view> </view>
</template> </template>
...@@ -55,15 +56,20 @@ ...@@ -55,15 +56,20 @@
import { import {
orderList orderList
} from "@/api/order.js" } from "@/api/order.js"
import list from "../../uni_modules/uview-ui/libs/config/props/list";
import NoLogin from "@/components/noLogin/noLogin"
export default { export default {
components:{
NoLogin
},
data() { data() {
return { return {
status: 'nomore ', status: 'nomore ',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '上划加载', loadmoreText: '上划加载',
nomoreText: '到底啦', nomoreText: '到底啦',
statusIndex: "", statusIndex: 0,
list: [], list: [],
statusList: [{ statusList: [{
label: "全部", label: "全部",
...@@ -91,11 +97,18 @@ ...@@ -91,11 +97,18 @@
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
loginStatus:true
}; };
}, },
onLoad() { onLoad() {
}, },
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
onShow() { onShow() {
this.onLoading() this.onLoading()
}, },
...@@ -104,17 +117,33 @@ ...@@ -104,17 +117,33 @@
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}) })
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
orderList(this.queryParams).then(res => { orderList(this.queryParams).then(res => {
console.log(res) console.log(res)
uni.hideLoading() uni.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
if(this.queryParams.pageNum ==1){
this.list = res.data.rows this.list = res.data.rows
}else{
this.list = [...this.list,...res.data.rows]
}
if(this.list.length < res.data.total){
this.status = "loadmore"
}else{
this.status = 'nomore'
}
}else if(res.data.code == 401){
this.loginStatus = false
} }
}) })
}, },
tabSelect(e) { tabSelect(i) {
console.log(e, 99999) console.log(i, 99999)
this.statusIndex = e.currentTarget.dataset.id; this.statusIndex = i;
this.queryParams.pageNum = 1;
this.list = []
this.onLoading()
}, },
onNavToOrderInfo(val){ onNavToOrderInfo(val){
uni.navigateTo({ uni.navigateTo({
...@@ -124,7 +153,11 @@ ...@@ -124,7 +153,11 @@
} }
} }
</script> </script>
<style>
page{
background-color: #ffffff;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-record { .order-record {
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment