提交 78b56364 authored 作者: 何忠建's avatar 何忠建

优化调整

上级 035b6dff
......@@ -101,14 +101,24 @@
//获取手机号
onGetPhoneNumber(e) {
let _this = this
if (e.detail.errMsg === "getPhoneNumber:fail user deny") { //用户决绝授权
//拒绝授权后弹出一些提示
uni.showModal({
content: '您拒绝了授权,登录失败!',
showCancel: false
if (_this.result.sessionKey) {
if (e.detail.errMsg === "getPhoneNumber:fail user deny") { //用户决绝授权
//拒绝授权后弹出一些提示
uni.showModal({
content: '您拒绝了授权,登录失败!',
showCancel: false
})
} else { //允许授权
_this.getUserPhone(e)
}
} else {
wx.login({
success(res) {
if (res.code) {
_this.getCode(res.code)
}
}
})
} else { //允许授权
_this.getUserPhone(e)
}
},
// 获取手机号
......@@ -139,7 +149,7 @@
uni.setStorageSync('token', res.result.token);
let userInfo = res.result.userInfo;
if (userInfo) {
uni.setStorageSync('platform_code',userInfo.platformCode)
uni.setStorageSync('platform_code', userInfo.platformCode)
uni.setStorageSync('user_phone', userInfo.phone);
uni.setStorageSync('user_name', userInfo.realname);
let img = userInfo.avatar ?
......@@ -148,7 +158,7 @@
}
this.$emit('loginEnd')
this.$refs.authorization.close()
}else{
} else {
wx.clearStorage()
}
},
......
......@@ -8,7 +8,7 @@
<view class="picture-box">
<text class="text">头像</text>
<button class="button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" hover-class="none">
<image class="avatar" :src="userForm.userAvatarUrl || 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/lxLTJxnMqmF4536a26893262a4d66527a51bcab612c9_1687861702460.png'" mode="aspectFill"></image>
<image class="avatar" :src="userForm.userAvatarUrl" mode="aspectFill" v-if="userForm.userAvatarUrl"></image>
</button>
</view>
<view class="picture-box">
......
......@@ -63,10 +63,12 @@ http.interceptors.response.use((response) => {
}
}, 30)
//未登录时清空缓存跳转
if (response.statusCode == 401) {
if (!response.statusCode) {
wx.clearStorage()
}else if (response.statusCode == 401) {
uni.showToast({
icon: "none",
title: 'Token失效,请重新登录!'
title: '登录过期,请重新登录!'
})
wx.clearStorage()
uni.showTabBar()
......
......@@ -35,25 +35,28 @@
isFinish: false
}
},
computed: {
},
computed: {},
methods: {
async getList(flag) {
let {
result
} = await getCompanyListApi(this.page)
let data = result.records;
if (flag) {
uni.stopPullDownRefresh();
this.dataList = [].concat(data)
} else {
this.dataList = this.dataList.concat(data)
}
if (data.length < 10) {
this.isFinish = true
} else {
this.page.pageNo += 1
if (result && result.records) {
let data = result.records;
if (flag) {
uni.stopPullDownRefresh();
this.dataList = [].concat(data)
} else {
this.dataList = this.dataList.concat(data)
}
if (data.length < 10) {
this.isFinish = true
} else {
this.page.pageNo += 1
}
}
},
onChangeHouse(item) {
if (item.communityCode) {
......@@ -106,10 +109,10 @@
padding: 20rpx 30rpx;
.item {
font-size: 28rpx;
font-size: 32rpx;
color: #373737;
height: 84rpx;
line-height: 84rpx;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #F8F6F9;
&.active {
......
......@@ -10,7 +10,8 @@
<uni-icons type="person" size="20px" color="#666666" v-else
@click="toLogin"></uni-icons>
</view>
<view class="name" v-if="userPhone">{{userPhone}}</view>
<view class="name" v-if="userName">{{userName}}</view>
<view class="name" v-else @click="toLogin">未登录</view>
</view>
</view>
</view>
......@@ -391,6 +392,7 @@
if (token) {
this.isLogin = true
this.userAvatar = uni.getStorageSync('user_avatar')
this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone')
this.getData();
} else {
......@@ -409,6 +411,7 @@
if (token) {
this.isLogin = true
this.userAvatar = uni.getStorageSync('user_avatar')
this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone')
} else {
wx.clearStorage()
......
......@@ -5,7 +5,7 @@
<view class="image">
<image
:src="imageURL+details.communityImage"
class="icon"></image>
class="icon" v-if="details.communityImage"></image>
</view>
<view class="details">
<view class="content">
......@@ -76,25 +76,6 @@
...result
}
},
async onSubmit() {
// await editCommunityRepairApi({
// id: this.formModel.id,
// repairEvaluate: this.evaluation,
// evaluateCount: this.rateValue
// })
// uni.$emit('change-maintenance');
// setTimeout(() => {
// uni.showToast({
// title: '评价成功!',
// icon: 'none'
// });
// setTimeout(() => {
// uni.navigateBack({
// delta: 2
// });
// }, 1500)
// }, 30)
},
},
onLoad(option) {
const token = uni.getStorageSync('token');
......
......@@ -49,17 +49,19 @@
let {
result
} = await getCompanyListApi(this.page)
let data = result.records;
if (flag) {
uni.stopPullDownRefresh();
this.dataList = [].concat(data)
} else {
this.dataList = this.dataList.concat(data)
}
if (data.length < 10) {
this.isFinish = true
} else {
this.page.pageNo += 1
if (result && result.records) {
let data = result.records;
if (flag) {
uni.stopPullDownRefresh();
this.dataList = [].concat(data)
} else {
this.dataList = this.dataList.concat(data)
}
if (data.length < 10) {
this.isFinish = true
} else {
this.page.pageNo += 1
}
}
},
toDetails(id) {
......
......@@ -9,9 +9,7 @@
头像
</view>
<view class="form-item-fr">
<image
:src="formData.avatar || 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/lxLTJxnMqmF4536a26893262a4d66527a51bcab612c9_1687861702460.png'"
class="icon"></image>
<image :src="formData.avatar" class="icon" v-if="formData.avatar"></image>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
......@@ -83,7 +81,7 @@
data() {
return {
formData: {
id:'',
id: '',
avatar: '',
temAvatar: '',
realname: '',
......@@ -117,7 +115,7 @@
let userInfo = res.result.userInfo;
let avatar = userInfo.avatar ? `${serverConfig.imageURL}${userInfo.avatar}` : ''
this.formData = {
id:userInfo.id,
id: userInfo.id,
avatar,
temAvatar: userInfo.avatar,
realname: userInfo.realname,
......@@ -127,6 +125,8 @@
address: userInfo.platformName,
//platformCode: userInfo.platformCode
}
uni.setStorageSync('user_phone', userInfo.phone);
uni.setStorageSync('user_name', avatar);
}
},
onOpenAvatar() {
......@@ -157,7 +157,7 @@
}
let avatar = uploadImg || this.formData.temAvatar
await userEditApi({
id:this.formData.id,
id: this.formData.id,
avatar,
realname: this.formData.realname,
sex: this.formData.sex,
......
......@@ -29,7 +29,11 @@
</view>
<view class="item">
<view class="name">支付方式</view>
<view class="detail">{{details.payWay}}</view>
<view class="detail">
<template v-if="details.payWay === 'payPropertyFee'">抵扣物业费</template>
<template v-else-if="details.payWay === 'refundOrder'">申请退款</template>
<template v-else-if="details.payWay === 'scanQrCodePay'">扫码支付</template>
</view>
</view>
<view class="item">
<view class="name">订单来源</view>
......
......@@ -15,6 +15,7 @@
</template>
<script>
import serverConfig from '@/config/server_config.js';
import {
getShopQrCode
} from '@/config/api.js'
......@@ -26,28 +27,42 @@
},
data() {
return {
baseURL: '',
imgUrl: ''
}
},
methods: {
async getDetail(code) {
let {
result
} = await getShopQrCode({
shopCode: code,
platformType: 'partner'
})
if (result && result != undefined) {
this.imgUrl = window.URL.createObjectURL(new Blob([result]));
}
getDetail(code) {
const token = uni.getStorageSync('token');
const tenantId = uni.getStorageSync('platform_code');
uni.request({
url: this.baseURL + "/property-central/shop/shopInfo/getQrCode",
method: "GET",
header: {
'content-type': 'application/json;charset:utf-8',
'X-Access-Token': token,
'tenant-id': tenantId
},
responseType: "arraybuffer",
data: {
shopCode: code,
platformType: "partner"
},
success: res => {
let datas = res.data
this.imgUrl = 'data:image/jpeg;base64,'+ uni.arrayBufferToBase64(datas)
},
});
}
},
onLoad(option) {
const token = uni.getStorageSync('token');
if (token && option.code) {
this.baseURL = `${serverConfig.baseURL}`
this.getDetail(option.code)
}
}
},
}
</script>
<style>
......
......@@ -43,7 +43,7 @@
<view class="item text">
<view class="name">商铺图</view>
<view class="image">
<image :src="imageURL+details.logoUrl" class="icon"></image>
<image :src="imageURL+details.logoUrl" class="icon" v-if="details.logoUrl"></image>
</view>
</view>
<view class="item text">
......
......@@ -6,11 +6,13 @@
@cancel="cancel" />
</view>
<view class="list" v-if="dataList.length">
<view class="item" v-for="item in dataList" :key="item.id"
@click="toDetails(item)">
<view class="item" v-for="item in dataList" :key="item.id" @click="toDetails(item)">
<image mode="aspectFill" :src="imageURL+item.shopInfo.logoUrl" class="icon"></image>
<view class="con">
<view class="name">{{item.shopName}}</view>
<view class="name">{{item.shopName}}
<view class="tag purple" v-if="item.bindPartners === 'Y'">未绑定</view>
<view class="tag gray" v-else>已绑定</view>
</view>
<view class="text">{{item.shopInfo.shopContent}}</view>
<view class="card">
<image mode="aspectFill" src="../../static/images/icon_licence.png" class="icon"></image>
......@@ -38,19 +40,20 @@
data() {
return {
page: {
column:'createTime',
order:'desc',
column: 'createTime',
order: 'desc',
pageSize: 10,
pageNo: 1
pageNo: 1,
auditStatus: 'auditPass',
shopStatus: 'normal'
},
dataList: [],
isFinish: false,
imageURL: '',
communityCode:''
communityCode: ''
}
},
computed: {
},
computed: {},
methods: {
async getList(flag) {
let {
......@@ -86,9 +89,16 @@
},
toDetails(item) {
if (item.shopInfo.id) {
uni.navigateTo({
url: `/pages/shopsDetails/index?id=${item.shopInfo.id}&code=${this.communityCode}`
});
if (item.bindPartners === 'Y') {
uni.navigateTo({
url: `/pages/shopsDetails/index?id=${item.shopInfo.id}&code=${this.communityCode}`
});
} else {
uni.showToast({
icon: "none",
title: '该商铺已绑定合作伙伴,请重新选择!'
})
}
}
},
},
......@@ -165,6 +175,7 @@
.con {
margin-left: 30rpx;
padding-right: 10rpx;
width: 100%;
.name {
font-size: 32rpx;
......@@ -180,6 +191,29 @@
}
.tag {
padding: 0 24rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
border-radius: 36rpx;
float: right;
}
.purple {
color: #6A59F2;
background-color: #F5F4FF;
border: 1px solid #6A59F2;
}
.gray {
color: #B6B6BA;
background-color: #F8F8F8;
border: 1px solid #B6B6BA;
}
.text {
font-size: 28rpx;
color: #9D9CA6;
......
......@@ -6,7 +6,7 @@
</view>
<view class="withdrawal">
<view class="list" v-if="dataList.length">
<view class="item" v-for="item in dataList" :key="item.id">
<view class="item" v-for="item in dataList" :key="item.id" @click="toDetail(item.id)">
<view class="title">
<view class="name">{{item.balanceNum}}</view>
<view class="tag">已结算</view>
......@@ -78,6 +78,13 @@
this.page.pageNo += 1
}
},
toDetail(id) {
if (id) {
uni.navigateTo({
url: `/pages/settlementDetails/index?id=${id}`,
});
}
},
search(value) {
if (value.value) {
this.page.balanceNum = value.value.toString();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论