提交 9d557b59 authored 作者: 何忠建's avatar 何忠建

小程序联调

上级 ff1b14c3
<template>
<view>
<uni-popup ref="authorization" background-color="#fff">
<view class="content-page" @touchmove="stopTouchMove">
<view class="content-page" @touchmove="stopTouchMove">
<view class="img-box">
<image style="width: 100rpx; height: 100rpx;margin:22rpx;" mode="aspectFill" src="../static/images/logo.png"></image>
<image style="width: 100rpx; height: 100rpx;margin:22rpx;" mode="aspectFill"
src="../static/images/logo.png"></image>
</view>
<view class="text">为了更完美的体验,请授权获取电话</view>
<button v-if="checked" class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" hover-class="none">手机号登录</button>
<button v-if="checked" class="login-btn" type="primary" open-type="getPhoneNumber"
@getphonenumber="onGetPhoneNumber" hover-class="none">手机号登录</button>
<button v-else class="login-btn" type="primary" @click="verifyPolicy" hover-class="none">手机号登录</button>
<view class="refuse" @click="refuse">取消</view>
......@@ -14,7 +16,8 @@
<checkbox-group @change="changePolicy">
<label>
<view class="policy-box">
<checkbox value="true" :checked="checked" color="#1677FF" style="transform:scale(0.7)" />
<checkbox value="true" :checked="checked" color="#1677FF"
style="transform:scale(0.7)" />
<text class="text">我已阅读并同意</text>
<text class="policy" @click.stop="readAgreement">《用户服务协议》</text>
<text class="text"></text>
......@@ -23,16 +26,17 @@
</label>
</checkbox-group>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import serverConfig from '@/config/server_config.js';
import {
analysisMobileApi,
getPropertyLoginApi,
bindingUserInfoApi
queryLoginPhoneApi
} from "@/config/api.js"
export default {
data() {
......@@ -43,10 +47,10 @@
},
watch: {
checked(newV) {
if(newV) {
if (newV) {
let _this = this
wx.login({
success (res) {
success(res) {
if (res.code) {
_this.getCode(res.code)
}
......@@ -57,8 +61,19 @@
},
methods: {
async getCode(code) {
let {result} = await getPropertyLoginApi({code}, {custom: {load: false}})
this.result = {...result}
let {
result
} = await getPropertyLoginApi({
code,
type: 'partner'
}, {
custom: {
load: false
}
})
this.result = {
...result
}
},
onOpenLogin() {
this.$refs.authorization.open('center')
......@@ -75,7 +90,7 @@
})
},
verifyPolicy(e) {
if(!this.checked) {
if (!this.checked) {
uni.showToast({
title: '请先同意协议和政策',
icon: 'none'
......@@ -98,7 +113,6 @@
},
// 获取手机号
async getUserPhone(e) {
let res = await analysisMobileApi({
code: e.detail.code,
iv: e.detail.iv,
......@@ -108,26 +122,36 @@
if (res.code === 200 && res.result) {
uni.setStorageSync('openid', this.result.openid);
let data = JSON.parse(res.result)
uni.setStorageSync('user_phone', data.purePhoneNumber);
//uni.setStorageSync('user_phone', data.purePhoneNumber);
// this.$emit('loginEnd')
// this.$refs.authorization.close()
this.getUserInfo(data.purePhoneNumber);
}
},
// 查询用户用户
async getUserInfo(phone) {
let params = {
loginName: phone,
platformType: 'partner'
}
let res = await queryLoginPhoneApi(params)
if (res.code === 200 && res.result && res.result.token) {
uni.setStorageSync('token', res.result.token);
let userInfo = res.result.userInfo;
if (userInfo) {
uni.setStorageSync('platform_code',userInfo.platformCode)
uni.setStorageSync('user_phone', userInfo.phone);
uni.setStorageSync('user_name', userInfo.realname);
let img = userInfo.avatar ?
`${serverConfig.imageURL}${userInfo.avatar}` : ''
uni.setStorageSync('user_avatar', img)
}
this.$emit('loginEnd')
this.$refs.authorization.close()
}else{
wx.clearStorage()
}
},
// 绑定用户
// async onbindingUserInfo(openId, phone) {
// let res = await bindingUserInfoApi({openId, phone})
// if(res.code === 200 && res.result) {
// uni.setStorageSync('openid', res.result.communityUser.openid);
// if(res.result.communityOwners && res.result.communityOwners.length) { // 业主
// this.$emit('loginEnd', true)
// } else if(res.result.employeeVos && res.result.employeeVos.comList.length) { // 维修员
// this.$emit('loginEnd', true)
// } else {
// this.$emit('loginEnd', false)
// }
// this.$refs.authorization.close()
// }
// },
changePolicy(e) {
this.checked = e.detail.value.length === 1
},
......@@ -146,65 +170,70 @@
</script>
<style lang="scss">
.content-page {
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.img-box {
width: 144rpx;
height: 144rpx;
border: 2rpx solid #E4E6E9;
border-radius: 50%;
margin-top: 200rpx;
}
.text {
font-size: 28rpx;
color: #3D3D3D;
line-height: 50rpx;
margin-top: 50rpx;
}
.login-btn {
width: 578rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #6799F1;
border-radius: 200rpx;
margin-top: 72rpx;
}
.refuse {
font-size: 28rpx;
color: #767676;
line-height: 33rpx;
margin-top: 34rpx;
}
.content-page {
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.img-box {
width: 144rpx;
height: 144rpx;
border: 2rpx solid #E4E6E9;
border-radius: 50%;
margin-top: 200rpx;
}
.policy-fixed {
position: fixed;
bottom: 160rpx;
left: 0;
right: 0;
z-index: 11;
.text {
font-size: 28rpx;
color: #3D3D3D;
line-height: 50rpx;
margin-top: 50rpx;
}
.policy-box {
padding: 0 30rpx;
font-size: 14px;
vertical-align: middle;
.login-btn {
width: 578rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #6799F1;
border-radius: 200rpx;
margin-top: 72rpx;
}
.text {
color: #191A23;
vertical-align: middle;
}
.policy {
color: #1677FF;
.refuse {
font-size: 28rpx;
color: #767676;
line-height: 33rpx;
margin-top: 34rpx;
}
.policy-fixed {
position: fixed;
bottom: 160rpx;
left: 0;
right: 0;
z-index: 11;
.policy-box {
padding: 0 30rpx;
font-size: 14px;
vertical-align: middle;
.text {
color: #191A23;
vertical-align: middle;
}
.policy {
color: #1677FF;
vertical-align: middle;
}
}
}
}
}
</style>
</style>
\ No newline at end of file
差异被折叠。
......@@ -2,62 +2,69 @@ import Request from '@/utils/luch-request/luch-request/index.js'
import serverConfig from './server_config.js'
const http = new Request()
http.setConfig((config) => { /* config 为默认全局配置*/
config.baseURL = serverConfig.baseURL;
config.header = {
'Content-Type': 'application/json;charset=UTF-8'
}
return config
http.setConfig((config) => {
/* config 为默认全局配置*/
config.baseURL = serverConfig.baseURL;
config.header = {
'Content-Type': 'application/json;charset=UTF-8'
}
return config
})
//请求前拦截
let loginPopupNum = 0;
http.interceptors.request.use((config) => { // 可使用async await 做异步操作
config.header = {
...config.header,
}
//获取存储的token
// const token = uni.getStorageSync('token');
// config.header['X-Token'] = token;
// 根据custom参数中配置的是否需要loading
if (config.custom.load) {
loginPopupNum ++
uni.showLoading({
title: '加载中...'
});
}
return config
config.header = {
...config.header,
}
//获取存储的token
const token = uni.getStorageSync('token');
const tenantId = uni.getStorageSync('platform_code');
if (token) {
config.header['X-Access-Token'] = token;
config.header['tenant-id'] = tenantId;
}
// 根据custom参数中配置的是否需要loading
if (config.custom.load) {
loginPopupNum++
uni.showLoading({
title: '加载中...'
});
}
return config
}, config => { // 可使用async await 做异步操作
return Promise.reject(config)
return Promise.reject(config)
})
// 请求后拦截器
http.interceptors.response.use((response) => {
setTimeout(()=> {
loginPopupNum --
if(loginPopupNum <= 0) {
uni.hideLoading();
}
}, 30)
if(Array.isArray(response.data) || response.data.success) {
return response.data
} else {
setTimeout(()=> {
uni.showToast({
title: response.data.message,
icon: 'none',
duration: 2000
})
}, 60)
return Promise.reject(response)
}
setTimeout(() => {
loginPopupNum--
if (loginPopupNum <= 0) {
uni.hideLoading();
}
}, 30)
if (Array.isArray(response.data) || response.data.success) {
return response.data
} else {
setTimeout(() => {
uni.showToast({
title: response.data.message,
icon: 'none',
duration: 2000
})
}, 60)
return Promise.reject(response)
}
}, (response) => {
setTimeout(()=> {
loginPopupNum --
if(loginPopupNum <= 0) {
uni.hideLoading();
}
}, 30)
return Promise.reject(response)
setTimeout(() => {
loginPopupNum--
if (loginPopupNum <= 0) {
uni.hideLoading();
}
}, 30)
return Promise.reject(response)
})
export { http }
\ No newline at end of file
export {
http
}
\ No newline at end of file
......@@ -26,6 +26,12 @@
"navigationBarTitleText": "选择商铺"
}
},
{
"path": "pages/myShopsList/index",
"style": {
"navigationBarTitleText": "我的商铺"
}
},
{
"path": "pages/shopsDetails/index",
"style": {
......
......@@ -3,66 +3,97 @@
<view class="page">
<view class="search">
<uni-search-bar placeholder="请输入小区名" bgColor="#EEEEEE" @confirm="search" @cancel="cancel" />
<view class="list">
<view class="item" :class="{'active': item.communityCode === currentHouseCode}" @click="onChangeHouse(item)" v-for="item in houseList" :key="item.communityCode">
<view class="list" v-if="dataList.length">
<view class="item" @click="onChangeHouse(item)" v-for="item in dataList" :key="item.communityCode">
{{item.communityName}}
</view>
</view>
<no-data :show="dataList.length === 0" text="暂无数据"></no-data>
</view>
</view>
</view>
</template>
<script>
import { getCompanyListApi } from '@/config/api.js'
let houseAllList = []
import {
getCompanyListApi
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
export default {
components: {
noData
},
data() {
return {
houseList: [],
currentHouseCode: ''
page: {
pageSize: 10,
pageNo: 1
},
dataList: [],
isFinish: false
}
},
computed: {
hideAdd() {
return this.dataList.some(item => item.auditStatus !== 'auditPass')
}
},
methods: {
async getList() {
let {result} = await getCompanyListApi()
houseAllList = result
this.houseList = [...result]
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
}
},
onChangeHouse(item) {
uni.navigateTo({
url: '/pages/shopsList/index'
});
// getApp().globalData.registerInfo = {}
// // if(item.communityCode === this.currentHouseCode) return
// uni.setStorageSync('user_type', '1')
// uni.setStorageSync('property_code', item.platformCode)
// uni.setStorageSync('property_name', item.platformName)
// uni.setStorageSync('platform_code', item.communityCode)
// uni.setStorageSync('platform_name', item.communityName)
// uni.reLaunch({
// url: '/pages/home/index'
//})
if (item.communityCode) {
uni.navigateTo({
url: '/pages/shopsList/index?code=' + item.communityCode
});
}
},
search(value) {
this.houseList = houseAllList.filter(item=> {
return item.communityName.includes(value.value)
})
console.log(value)
if (value.value) {
this.page.communityName = value.value.toString();
this.dataList = [];
this.page.pageNo = 1;
this.getList();
}
},
cancel() {
this.houseList = [...houseAllList]
this.dataList = [];
this.page.communityName = '';
this.page.pageNo = 1;
this.getList();
}
},
onLoad() {
this.currentHouseCode = uni.getStorageSync('platform_code') || ''
let type = uni.getStorageSync('user_type')
if(type === '2') {
let data = uni.getStorageSync('user_house_list')
houseAllList = JSON.parse(data)
this.houseList = [...houseAllList]
} else {
const token = uni.getStorageSync('token');
if (token) {
this.getList()
}
},
onPullDownRefresh() {
this.page.pageNo = 1
this.getList(true)
},
onReachBottom() {
if (this.isFinish) return
this.getList()
}
}
</script>
......@@ -75,13 +106,15 @@
.search {
.list {
padding:20rpx 30rpx;
padding: 20rpx 30rpx;
.item {
font-size: 28rpx;
color: #373737;
height: 84rpx;
line-height: 84rpx;
border-bottom: 1px solid #F8F6F9;
&.active {
color: #6A59F2;
}
......
......@@ -5,7 +5,12 @@
<view class="nav-top">
<view class="title">
<view class="icons">
<uni-icons type="person" size="20px" color="#666666"></uni-icons>
<view class="box">
<image :src="userAvatar" class="icon" v-if="userAvatar"></image>
<uni-icons type="person" size="20px" color="#666666" v-else
@click="toLogin"></uni-icons>
</view>
<view class="name" v-if="userPhone">{{userPhone}}</view>
</view>
</view>
</view>
......@@ -113,6 +118,7 @@
</view>
</view>
</view>
<authorization-modal ref="authorization" @loginEnd="onLoginEnd" @refuse="onRefuse" />
</view>
</template>
......@@ -143,8 +149,12 @@
},
data() {
return {
statusBarHeight: 24,
isLogin: false,
userName: '',
userAvatar: '',
userPhone: '',
statusBarHeight: 24,
houseInfo: {}, // 当前小区信息
bannerList: [],
chartData: {},
......@@ -230,6 +240,12 @@
this.getServerData();
},
methods: {
toLogin() {
uni.hideTabBar()
this.$nextTick(() => {
this.$refs.authorization.onOpenLogin()
});
},
async getPropertyAdv() {
let {
result
......@@ -283,35 +299,43 @@
// });
},
quickEntry(type) {
if (type == 1) {
uni.navigateTo({
url: '/pages/community/index'
});
} else if (type == 2) {
uni.navigateTo({
url: '/pages/shopsList/index'
});
} else if (type == 3) {
uni.navigateTo({
url: '/pages/myCommunityList/index',
});
} else if (type == 4) {
uni.navigateTo({
url: '/pages/reconciliationList/index'
});
} else if (type == 5) {
uni.navigateTo({
url: '/pages/settlementList/index'
});
} else if (type == 6) {
uni.navigateTo({
url: '/pages/withdrawalList/index'
});
if (this.isLogin) {
if (type == 1) {
uni.navigateTo({
url: '/pages/community/index'
});
} else if (type == 2) {
uni.navigateTo({
url: '/pages/myShopsList/index'
});
} else if (type == 3) {
uni.navigateTo({
url: '/pages/myCommunityList/index',
});
} else if (type == 4) {
uni.navigateTo({
url: '/pages/reconciliationList/index'
});
} else if (type == 5) {
uni.navigateTo({
url: '/pages/settlementList/index'
});
} else if (type == 6) {
uni.navigateTo({
url: '/pages/withdrawalList/index'
});
}
} else {
uni.showToast({
icon: "none",
title: '请登录后在操作!'
})
wx.clearStorage()
}
},
onLoginEnd() {
uni.showTabBar()
//this.getUserInfo()
this.initData()
},
onRefuse() {
uni.showTabBar()
......@@ -325,9 +349,12 @@
},
initData() {
this.getPropertyAdv()
let isLogin = uni.getStorageSync('openid')
if (!!isLogin) {
//this.getUserInfo()
const token = uni.getStorageSync('token');
if (token) {
this.isLogin = true
//this.userName = uni.getStorageSync('user_name')
this.userAvatar = uni.getStorageSync('user_avatar')
this.userPhone = uni.getStorageSync('user_phone')
}
}
},
......@@ -368,20 +395,34 @@
display: flex;
align-items: center;
.title {
font-size: 32rpx;
color: #1D1F1C;
font-weight: 700;
}
.icons {
width: 58rpx;
height: 58rpx;
background-color: #ffffff;
border-radius: 58rpx;
display: flex;
align-items: center;
justify-content: center;
.box {
width: 58rpx;
height: 58rpx;
background-color: #ffffff;
border-radius: 58rpx;
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 58rpx;
height: 58rpx;
border-radius: 58rpx;
}
}
.name {
font-size: 28rpx;
color: #1D1F1C;
margin-left: 14rpx;
}
}
}
......
......@@ -3,22 +3,22 @@
style="background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/bg_me1_1692254734871.png');">
<view class="page">
<view class="user">
<template v-if="userAvatar">
<image :src="userAvatar" class="icon"></image>
<template v-if="isLogin && userAvatar">
<image :src="userAvatar" class="icon" ></image>
</template>
<view class="icon" v-else>
<uni-icons type="person" size="50px" color="#6A59F2"></uni-icons>
</view>
<template v-if="userPhone">
<view class="name">林二</view>
<view class="phone">15245214563</view>
<template v-if="isLogin">
<view class="name" v-if="userName">{{userName}}</view>
<view class="phone" v-if="userPhone">{{userPhone}}</view>
<div class="information" @click="employeeEntry(1)">修改个人资料 ></div>
</template>
<teleport v-else>
<view class="name" @click="toLogin" style="margin-bottom: 36rpx;">请登录</view>
</teleport>
</view>
<view class="LogOut" v-if="userPhone" @click="logout">退出登录</view>
<view class="LogOut" v-if="isLogin" @click="logout">退出登录</view>
</view>
......@@ -35,12 +35,10 @@
},
data() {
return {
currentHouseVerify: false,
userType: '0',
isLogin: false,
userName: '',
userAvatar: '',
userPhone: '',
isEmployee: false
}
},
methods: {
......@@ -50,7 +48,7 @@
this.$refs.authorization.onOpenLogin()
});
},
logout(){
logout() {
let _this = this
uni.showModal({
title: '警告',
......@@ -59,13 +57,13 @@
success: function(res) {
if (res.confirm) {
wx.clearStorage()
_this.onLoginEnd()
}
}
});
},
quickEntry(type) {
let isLogin = uni.getStorageSync('openid')
if (!!isLogin) {
employeeEntry(type) {
if (this.isLogin) {
if (type == 1) {
uni.navigateTo({
url: '/pages/myInformation/index',
......@@ -78,17 +76,6 @@
});
}
},
employeeEntry(type) {
if (type == 1) {
uni.navigateTo({
url: '/pages/myInformation/index',
});
} else {
uni.navigateTo({
url: '/pages/repairList/index',
});
}
},
onLoginEnd() {
uni.showTabBar()
uni.reLaunch({
......@@ -98,19 +85,17 @@
onRefuse() {
uni.showTabBar()
},
onChangeEmployee(type) {
uni.setStorageSync('user_type', type)
uni.reLaunch({
url: '/pages/home/index'
})
}
},
onLoad() {
this.userType = uni.getStorageSync('user_type')
this.userName = uni.getStorageSync('user_name')
this.userAvatar = uni.getStorageSync('user_avatar')
this.userPhone = uni.getStorageSync('user_phone')
this.isEmployee = !!uni.getStorageSync('employee_code')
const token = uni.getStorageSync('token');
if (token) {
this.isLogin = true
this.userName = uni.getStorageSync('user_name')
this.userAvatar = uni.getStorageSync('user_avatar')
this.userPhone = uni.getStorageSync('user_phone')
} else {
this.isLogin = false
}
},
onHide() {
if (timer) clearTimeout(timer)
......
<template>
<view class="container">
<view class="shops">
<view class="search">
<uni-search-bar placeholder="请输入商铺名" bgColor="#ffffff" radius="100" @confirm="search"
@cancel="cancel" />
</view>
<view class="list" v-if="dataList.length">
<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="tags">
<view :class="item.auditTatus === 'auditPass'?'tag purple':'tag gray'">
<template v-if="item.auditTatus === 'waitAudit'">待审核</template>
<template v-if="item.auditTatus === 'auditPass'">审核通过</template>
<template v-if="item.auditTatus === 'refuse'">审核拒绝</template>
</view>
<view class="tag red" v-if="item.freezingStatus === 'freeze'">冻结</view>
</view>
<view class="text">所属小区:{{item.communityName}}</view>
<view class="card">
<image mode="aspectFill" src="../../static/images/icon_licence.png" class="icon"></image>
{{item.creditCode}}
</view>
</view>
</view>
</view>
<no-data :show="dataList.length === 0" text="暂无数据"></no-data>
</view>
</view>
</template>
<script>
import serverConfig from '@/config/server_config.js';
import {
getMyShopList
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
export default {
components: {
noData
},
data() {
return {
page: {
column:'createTime',
order:'desc',
pageSize: 10,
pageNo: 1
},
dataList: [],
isFinish: false,
imageURL: '',
}
},
computed: {
hideAdd() {
return this.dataList.some(item => item.auditStatus !== 'auditPass')
}
},
methods: {
async getList(flag) {
let {
result
} = await getMyShopList(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
}
},
search(value) {
console.log(value)
if (value.value) {
this.page.shopName = value.value.toString();
this.dataList = [];
this.page.pageNo = 1;
this.getList();
}
},
cancel() {
this.dataList = [];
this.page.shopName = '';
this.page.pageNo = 1;
this.getList();
},
toDetails(item) {
if (item.shopInfo.id) {
uni.navigateTo({
url: `/pages/shopsDetails/index?id=${item.shopInfo.id}`
});
}
},
},
onLoad(option) {
const token = uni.getStorageSync('token');
if (token) {
this.imageURL = `${serverConfig.imageURL}`
this.getList()
}
}
}
</script>
<style>
page {
background-color: #F8F6F9;
}
.shops .uni-searchbar {
padding: 0;
}
</style>
<style lang="scss" scoped>
.page {
padding: 30rpx 0 0;
}
.shops {
border-radius: 16rpx;
.search {
margin: 30rpx 30rpx 0;
}
.list {
background-color: #F8F6F9;
padding: 30rpx;
.item {
background-color: #ffffff;
border-radius: 16rpx;
display: flex;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 0 25rpx 0 rgba(81, 89, 234, 0.06);
position: relative;
&::after {
content: " ";
position: absolute;
top: 30rpx;
right: 30rpx;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
z-index: 11;
}
&.noRead::after {
background-color: #F6C864;
;
}
.icon {
flex: none;
width: 176rpx;
height: 176rpx;
border-radius: 6rpx;
background: #eeeeee;
}
.con {
margin-left: 30rpx;
padding-right: 10rpx;
.name {
font-size: 32rpx;
color: #373737;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
/* 追加这一行代码 */
}
.tags{
display: flex;
margin: 6rpx 0;
.tag {
padding: 0 24rpx;
height: 36rpx;
line-height: 36rpx;
font-size: 24rpx;
text-align: center;
border-radius: 36rpx;
display: inline-block;
margin-right: 20rpx;
}
.purple {
color: #6A59F2;
background-color: #F5F4FF;
border: 1px solid #6A59F2;
}
.gray {
color: #B6B6BA;
background-color: #F8F8F8;
border: 1px solid #B6B6BA;
}
.red {
color: #f5222d;
background-color: #fff1f0;
border: 1px solid #f5222d;
}
}
.text {
font-size: 28rpx;
color: #9D9CA6;
margin: 6rpx 0 6rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
}
.card {
font-size: 28rpx;
color: #9D9CA6;
height: 30rpx;
line-height: 30rpx;
display: flex;
.icon {
width: 35rpx;
height: 28rpx;
margin-right: 10rpx;
}
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -6,110 +6,119 @@
<view class="content">
<view class="item">
<view class="name">所属小区</view>
<view class="detail">汉江之星小区</view>
<view class="detail">{{details.platformName}}</view>
</view>
<view class="item">
<view class="name">关联房屋</view>
<view class="detail">B栋201</view>
<view class="detail">{{details.roomName}}</view>
</view>
<view class="item">
<view class="name">商铺名称</view>
<view class="detail">寿康永乐</view>
<view class="detail">{{details.shopName}}</view>
</view>
<view class="item">
<view class="name">营业执照编码</view>
<view class="detail">BSHEHSJE12352421</view>
<view class="detail">{{details.creditCode}}</view>
</view>
<view class="item">
<view class="name">法人</view>
<view class="detail">张三</view>
<view class="detail">{{details.legalName}}</view>
</view>
<view class="item">
<view class="name">联系人</view>
<view class="detail">张三</view>
<view class="detail">{{details.contactName}}</view>
</view>
<view class="item">
<view class="name">联系人电话</view>
<view class="detail">张三 1301234****</view>
<view class="detail">{{details.contactPhone}}</view>
</view>
<view class="item text">
<view class="item">
<view class="name">注册地址</view>
<view class="detail">{{details.provinceName + details.cityName + details.countyName}}</view>
</view>
<view class="item">
<view class="name">详细地址</view>
<view class="detail">湖北省十堰市郧阳区汉江之星 小区B栋201</view>
<view class="detail">{{details.addressInfo}}</view>
</view>
<view class="item text" v-if="imageList.length">
<view class="item text">
<view class="name">商铺图</view>
<view class="image">
<image v-for="(url, index) in imageList" :key="index" :src="url" class="icon"></image>
<image :src="imageURL+details.logoUrl" class="icon"></image>
</view>
</view>
<view class="item text">
<view class="name">介绍</view>
<view class="detail">诚信经营,提供“新鲜、超值 休闲、时尚”的商品和服务</view>
<view class="detail">{{details.shopContent}}</view>
</view>
</view>
</view>
<view class="form-submit" @click="onSubmit">确认绑定</view>
<view class="form-submit" @click="toCode">商铺收款二维码</view>
<view class="form-submit" @click="onSubmit" v-if="communityCode">确认绑定</view>
<view class="form-submit" @click="toCode" v-else>商铺收款二维码</view>
</view>
</view>
</view>
</template>
<script>
import serverConfig from '@/config/server_config.js';
import {
getCommunityRepairDetailApi,
editCommunityRepairApi
getShopDetails,
partnersShopAdd
} from '@/config/api.js'
export default {
data() {
return {
rateValue: 5,
evaluation: '',
formModel: {
},
communityCode: '',
details: {},
imageURL: '',
imageList: ['https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/bg_1690786506694.png']
}
},
methods: {
async getDetail(id) {
// let {
// result
// } = await getCommunityRepairDetailApi({
// id
// })
// this.formModel = {
// ...result
// }
// this.imageList = result.repairPhoto ? result.repairPhoto.split(',') : []
let {
result
} = await getShopDetails({
id
})
this.details = {
...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)
if (this.details.shopCode && this.communityCode) {
await partnersShopAdd({
shopCode: this.details.shopCode,
communityCode: this.communityCode
})
setTimeout(() => {
uni.showToast({
title: '绑定成功,待待审核!',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({
delta: 2
});
}, 1500)
}, 30)
}
},
toCode(){
toCode() {
uni.navigateTo({
url: '/pages/shopsCode/index'
});
}
},
onLoad(option) {
this.getDetail(option.id)
const token = uni.getStorageSync('token');
if (token && option.id) {
if(option.code){
this.communityCode = option.code;
}
this.imageURL = `${serverConfig.imageURL}`
this.getDetail(option.id)
}
}
}
</script>
......
......@@ -5,74 +5,104 @@
<uni-search-bar placeholder="请输入商铺名" bgColor="#ffffff" radius="100" @confirm="search"
@cancel="cancel" />
</view>
<view class="list" v-if="allList.length">
<view class="item" :class="{'noRead' : item.readStatus === '2'}" v-for="item in allList" :key="item.id"
@click="toDetails(1)">
<image mode="aspectFill" :src="item.image" class="icon"></image>
<view class="list" v-if="dataList.length">
<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.title}}</view>
<view class="text">{{item.text}}</view>
<view class="name">{{item.shopName}}</view>
<view class="text">{{item.shopInfo.shopContent}}</view>
<view class="card">
<image mode="aspectFill" src="../../static/images/icon_licence.png" class="icon"></image>
{{item.card}}
{{item.shopInfo.creditCode}}
</view>
</view>
</view>
</view>
<no-data :show="allList.length === 0" text="暂无数据"></no-data>
<no-data :show="dataList.length === 0" text="暂无数据"></no-data>
</view>
</view>
</template>
<script>
import serverConfig from '@/config/server_config.js';
import {
queryNoticePageApi
getShopList
} from '@/config/api.js'
import serverConfig from '@/config/server_config.js';
import noData from '@/components/no-data/no-data'
export default {
components: {
noData
},
data() {
return {
activeStatus: '',
allPageNo: 1,
yesPageNo: 1,
notPageNo: 1,
allList: [{
id: 1,
image: 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/bg_1690786506694.png',
title: '车之家(北京路店)',
text: '车辆介绍与洽谈、车辆演示、车辆选购、开票收款、交车和办理临牌',
card: '91510600MA6B00XP2F',
},{
id: 2,
image: 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/bg_1690786506694.png',
title: '鲜果乐园(北京路店)',
text: '果真好吃,回味甘甜,一口接着一口根本停不下来。',
card: '91510600MA6B00XP2F',
},{
id: 3,
image: 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/bg_1690786506694.png',
title: '寿康永乐(北京路店)',
text: '诚信经营,提供“新鲜、超值休闲、时尚”的商品和服务',
card: '91510600MA6B00XP2F',
}],
page: {
column:'createTime',
order:'desc',
pageSize: 10,
pageNo: 1
},
dataList: [],
isFinish: false,
imageURL: '',
communityCode:''
}
},
computed: {
hideAdd() {
return this.dataList.some(item => item.auditStatus !== 'auditPass')
}
},
computed: {},
methods: {
async getList() {
async getList(flag) {
let {
result
} = await getShopList(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
}
},
toDetails(id) {
uni.navigateTo({
url: `/pages/shopsDetails/index?id=${id}`
});
search(value) {
console.log(value)
if (value.value) {
this.page.shopName = value.value.toString();
this.dataList = [];
this.page.pageNo = 1;
this.getList();
}
},
cancel() {
this.dataList = [];
this.page.shopName = '';
this.page.pageNo = 1;
this.getList();
},
toDetails(item) {
if (item.shopInfo.id) {
uni.navigateTo({
url: `/pages/shopsDetails/index?id=${item.shopInfo.id}&code=${this.communityCode}`
});
}
},
},
onShow() {
//this.getList()
onLoad(option) {
const token = uni.getStorageSync('token');
if (token && option.code) {
this.imageURL = `${serverConfig.imageURL}`
this.page.communityCode = option.code;
this.communityCode = option.code;
this.getList()
}
}
}
</script>
......@@ -132,6 +162,7 @@
width: 176rpx;
height: 176rpx;
border-radius: 6rpx;
background: #eeeeee;
}
.con {
......@@ -170,6 +201,7 @@
height: 30rpx;
line-height: 30rpx;
display: flex;
.icon {
width: 35rpx;
height: 28rpx;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论