Commit d1353277 by zhangzhen

细节优化

parent 2eb426bb
...@@ -42,6 +42,11 @@ export const dictList=()=>{ ...@@ -42,6 +42,11 @@ export const dictList=()=>{
return http.get(url) return http.get(url)
} }
export const systemConfig=()=>{
let url=`/system/config/list`
return http.get(url,{pageNum:1,pageSize:100})
}
//上传文件 //上传文件
export const uploadFile=(data)=> { export const uploadFile=(data)=> {
console.log(data,"我要上传文件") console.log(data,"我要上传文件")
......
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
} }
], ],
timer:null, timer:null,
orderInfo:{} orderInfo:{},
servicePhone:''
}; };
}, },
watch:{ watch:{
...@@ -64,8 +65,21 @@ ...@@ -64,8 +65,21 @@
}, },
methods:{ methods:{
onGetSysConfig(){
let sysConfigList = uni.getStorageSync('sysConfig')
let s = sysConfigList.find(item=>item.configKey === 'wechat.customer.service.phone')
if(s){
this.servicePhone= s.configValue;
uni.makePhoneCall({
phoneNumber:this.servicePhone
})
}
},
onHandle(val,index){ onHandle(val,index){
console.log(val,index) if(index===3){
this.onGetSysConfig()
return
};
if([0,1].includes(index)){ if([0,1].includes(index)){
this.onGetOrderByAvailable(index) this.onGetOrderByAvailable(index)
return return
......
...@@ -121,7 +121,8 @@ ...@@ -121,7 +121,8 @@
import LoginPop from "@/components/login/login" import LoginPop from "@/components/login/login"
import { import {
login, login,
dictList dictList,
systemConfig
} from "@/api/index.js"; } from "@/api/index.js";
import { import {
getListStore getListStore
...@@ -193,6 +194,7 @@ ...@@ -193,6 +194,7 @@
} }
}, },
onShow() { onShow() {
this.onGetSysConfig();
if (uni.getStorageSync("storeId") && this.storeList.length) { if (uni.getStorageSync("storeId") && this.storeList.length) {
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
let obj = this.storeList.filter(item => item.id === this.storeId)[0] let obj = this.storeList.filter(item => item.id === this.storeId)[0]
...@@ -203,8 +205,8 @@ ...@@ -203,8 +205,8 @@
roomVoList: obj.roomVoList.length ? obj.roomVoList.map(item => { roomVoList: obj.roomVoList.length ? obj.roomVoList.map(item => {
return { return {
...item, ...item,
images: item.images ? item.images facilities: Array.isArray(item.facilities) ? item.facilities :item.facilities? item.facilities.split(",") : [],
.split(",").map(val => this.hostUrl + val) : [] images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : []
} }
}) : [] }) : []
...@@ -234,6 +236,15 @@ ...@@ -234,6 +236,15 @@
// this.$refs.loginPop.open() // this.$refs.loginPop.open()
}, },
methods: { methods: {
onGetSysConfig(){
systemConfig().then(res=>{
console.log(res,909090)
uni.setStorage({
key:'sysConfig',
data: res.data.rows
})
})
},
onGetDicts() { onGetDicts() {
let dicts = [] let dicts = []
if (uni.getStorageSync('dicts')) { if (uni.getStorageSync('dicts')) {
......
...@@ -53,25 +53,25 @@ ...@@ -53,25 +53,25 @@
</view> </view>
<view class="main"> <view class="main">
<view class="cu-list menu card-menu sm-border margin-top"> <view class="cu-list menu card-menu sm-border margin-top">
<view class="cu-item arrow"> <view class="cu-item arrow" @tap="onHandle(1)">
<view class="content"> <view class="content">
<image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image> <image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image>
<text class="text-grey">客服咨询</text> <text class="text-grey">客服咨询</text>
</view> </view>
</view> </view>
<view class="cu-item arrow"> <view class="cu-item arrow" @tap="onHandle(2)">
<view class="content"> <view class="content">
<image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image> <image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image>
<text class="text-grey">WIFI连接</text> <text class="text-grey">WIFI连接</text>
</view> </view>
</view> </view>
<view class="cu-item arrow"> <view class="cu-item arrow" @tap="onHandle(3)">
<view class="content"> <view class="content">
<image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image> <image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image>
<text class="text-grey">全国门店</text> <text class="text-grey">全国门店</text>
</view> </view>
</view> </view>
<view class="cu-item arrow"> <view class="cu-item arrow" @tap="onHandle(4)">
<view class="content"> <view class="content">
<image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image> <image :src="assetsPath+'/cart.png'" class="png" mode="aspectFit"></image>
<text class="text-grey">联系我们</text> <text class="text-grey">联系我们</text>
...@@ -87,6 +87,29 @@ ...@@ -87,6 +87,29 @@
</view> --> </view> -->
<LoginPop ref="loginPop" @success="onCheckUserLogin" /> <LoginPop ref="loginPop" @success="onCheckUserLogin" />
<f-tabbar></f-tabbar> <f-tabbar></f-tabbar>
<uni-popup ref="popup" type="bottom" maskClick="false">
<view class="popup-content">
<view class="flex-between title-box">
<text class="text-black text-bold text-xl">无线WIFI</text>
<text class="cuIcon-roundclose text-gray text-xxl" @tap="onClose"></text>
</view>
<view class="flex-col">
<view class="text">
<text class="text-title text-xl">wifi名称:</text>
<text class="text-title text-xxl">{{wifiData.name}}</text>
</view>
<view class="text">
<text class="text-title text-xl">wifi名称:</text>
<text class="text-title text-xxl">{{wifiData.password}}</text>
</view>
</view>
<view class="box-btn">
<button class="cu-btn line-pink lg" @tap="onCopy">复制密码</button>
<button class="cu-btn bg-pink lg" @tap='onConnectWifi'>一键连接</button>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
...@@ -136,10 +159,16 @@ ...@@ -136,10 +159,16 @@
type:"", type:"",
show:false show:false
} }
] ],
wifiData:{
name:"",
password:''
},
servicePhone:''
} }
}, },
onShow() { onShow() {
this.onGetSysConfig();
this.onCheckUserLogin(); this.onCheckUserLogin();
}, },
onLoad() { onLoad() {
...@@ -147,6 +176,19 @@ ...@@ -147,6 +176,19 @@
uni.hideTabBar(); uni.hideTabBar();
}, },
methods: { methods: {
onGetSysConfig(){
let sysConfigList = uni.getStorageSync('sysConfig')
let wifi = sysConfigList.find(item=>item.configKey === 'wechat.wifi')
if(wifi){
let w = wifi.configValue.split(';')
this.wifiData.name=w[0];
this.wifiData.password = w[1];
}
let s = sysConfigList.find(item=>item.configKey === 'wechat.customer.service.phone')
if(s){
this.servicePhone= s.configValue
}
},
onCheckUserLogin() { onCheckUserLogin() {
let tokenHeaders = uni.getStorageSync("tokenHeaders"); let tokenHeaders = uni.getStorageSync("tokenHeaders");
console.log(tokenHeaders, 909090) console.log(tokenHeaders, 909090)
...@@ -195,6 +237,49 @@ ...@@ -195,6 +237,49 @@
}) })
} }
}, },
onHandle(val){
if(val ==1){
uni.makePhoneCall({
phoneNumber:this.servicePhone
})
}else if(val == 2){
this.$refs.popup.open()
}else if(val === 3){
uni.navigateTo({
url:'/pages/storeList/storeList'
})
}
},
onClose(){
this.$refs.popup.close()
},
onCopy(){
uni.setClipboardData({
data:this.wifiData.password
})
},
onConnectWifi(){
uni.connectWifi({
SSID:this.wifiData.name,
BSSID:this.wifiData.name,
password:this.wifiData.password,
success: () => {
uni.showToast({
icon:"none",
title:'连接成功'
})
},
fail: (err) => {
uni.showToast({
icon:'none',
title:err.errMsg
})
},
complete: (res) => {
console.log(res,909090)
}
})
},
// 退出登录,解除手机号与当前微信的绑定 // 退出登录,解除手机号与当前微信的绑定
onLoginOut(){ onLoginOut(){
uni.showLoading({ uni.showLoading({
...@@ -338,4 +423,41 @@ ...@@ -338,4 +423,41 @@
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
.popup-content{
display: flex;
flex-direction: column;
width: 100vw;
min-height: 40vh;
background-color: #f1f1f1;
border-radius: 20upx 20upx 0 0;
.title-box{
padding: 30upx 20upx 0 20upx;
align-items: center;
.cuIcon-roundclose{
font-size: 68upx;
}
}
.flex-col{
display: flex;
flex: 1;
width: 100%;
flex-direction: column;
justify-content: center;
align-items: center;
.text{
width: 60%;
margin: 10upx 0;
}
}
.box-btn{
display: flex;
flex-direction: row;
padding: 30upx 0;
justify-content: center;
align-items: center;
.cu-btn{
margin: 0 5%;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -3,22 +3,14 @@ ...@@ -3,22 +3,14 @@
<view v-if="loginStatus" 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">
<view class=""> <view class="">
<text>{{item.payType==1?'微信支付':'余额支付'}}:</text> <text class="text-title">{{item.name}}:</text>
<text class="text-black text-bold text-lg">{{item.payPrice}}</text>
</view> </view>
<view class="flex-row"> <view class="flex-row">
<text>{{item.orderType==1?'房间预定':'房间续订'}}</text> <text class="text-black text-bold text-lg">{{item.payPrice}}</text>
</view> </view>
</view> </view>
<view class="flex-row part-1">
<text>订单编号:</text>
<text>{{item.orderNo}}</text>
</view>
<view class="flex-between part-1"> <view class="flex-between part-1">
<text>创建时间:</text> <text>创建时间:</text>
<text>{{item.createTime}}</text> <text>{{item.createTime}}</text>
......
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