Commit 1508d090 by honghong

商家端和用户端合并 修改页面

parent b1d6512d
...@@ -243,6 +243,7 @@ const collectOrUncollect = (params) => { ...@@ -243,6 +243,7 @@ const collectOrUncollect = (params) => {
return ApiHttp('/app-fund/forum/collect', params, 'POST') return ApiHttp('/app-fund/forum/collect', params, 'POST')
} }
// 查询论坛信息列表/商家我的动态 // 查询论坛信息列表/商家我的动态
const listForumGET = (params) => { const listForumGET = (params) => {
return ApiHttp('/app-fund/forum/list', params, 'GET') return ApiHttp('/app-fund/forum/list', params, 'GET')
...@@ -318,6 +319,12 @@ const getlistBgroupBuying = (groupId) => { ...@@ -318,6 +319,12 @@ const getlistBgroupBuying = (groupId) => {
return ApiHttp(`/app-fund/groupBuying/${groupId}`, '', 'GET') return ApiHttp(`/app-fund/groupBuying/${groupId}`, '', 'GET')
} }
//我的关注
const getattentionGET = (params) => {
return ApiHttp('/app-fund/home/attention/list', params, 'GET')
}
export { export {
agreementGET, agreementGET,
nodeListGET, nodeListGET,
...@@ -395,5 +402,6 @@ export { ...@@ -395,5 +402,6 @@ export {
deleteCommentItem, deleteCommentItem,
merchantPOST, merchantPOST,
listBgroupBuyingGET, listBgroupBuyingGET,
getlistBgroupBuying getlistBgroupBuying,
getattentionGET
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</view> </view>
<view class="d-flex"> <view class="d-flex">
<view v-if="isEdit" class="dynamic-delete mr-2" @click.stop="handleEdit(itemDetail.forumId)">编辑</view> <view v-if="isEdit" class="dynamic-delete mr-2" @click.stop="handleEdit(itemDetail.forumId)">编辑</view>
<view v-if="isDelete" class="dynamic-delete" @click.stop="handleDelete(itemDetail.forumId)">删除</view> <view v-if="userInfot.userId == itemDetail.userId" class="dynamic-delete" @click.stop="handleDelete(itemDetail.forumId)">删除</view>
</view> </view>
</view> </view>
</view> </view>
......
<template> <template>
<view> <view>
<view class="dynamic"> <view class="dynamic">
<image :src="itemDetail.imgs[0]" mode="aspectFit" class="bg"></image> <view v-if="type==1" class="imgs">
<image :src="item" mode="aspectFit" class="" v-for="(item,index) in itemDetail.imgs" :key="index"></image>
</view>
<image :src="itemDetail.imgs[0]" mode="aspectFit" class="bg" v-else></image>
<view class="" style="padding: 20rpx;"> <view class="" style="padding: 20rpx;">
<!-- <view class="dynamic-title">{{itemDetail.forumTitle}}</view> --> <!-- <view class="dynamic-title">{{itemDetail.forumTitle}}</view> -->
<!-- <view v-if="showAuthor" class="d-flex a-center" style="margin-top: 16rpx;"> <!-- <view v-if="showAuthor" class="d-flex a-center" style="margin-top: 16rpx;">
...@@ -79,6 +84,10 @@ ...@@ -79,6 +84,10 @@
isDelete:{ isDelete:{
type:Boolean, type:Boolean,
default:false default:false
},
type:{
type:Number,
default:0
} }
}, },
computed: { computed: {
...@@ -141,6 +150,17 @@ ...@@ -141,6 +150,17 @@
display: block; display: block;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
} }
.imgs{
display: flex;
flex-wrap: wrap;
>image{
width: 200rpx;
height: 200rpx;
margin-right: 20rpx;
}
}
&-title { &-title {
font-size: 30rpx; font-size: 30rpx;
color: #303949; color: #303949;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</block> </block>
</view> </view>
<!-- 靠左 --> <!-- 靠左 -->
<view class="inv-h-w" v-else> <view class="inv-h-w" style="background: #F8F9FA;" v-else>
<block v-for="(item,index) in list" :key="item.value"> <block v-for="(item,index) in list" :key="item.value">
<view :class="['inv-h',Inv == item.value?'inv-h-se':'']" @click="changeTab(item.value)">{{item.label}}</view> <view :class="['inv-h',Inv == item.value?'inv-h-se':'']" @click="changeTab(item.value)">{{item.label}}</view>
</block> </block>
......
...@@ -72,6 +72,14 @@ ...@@ -72,6 +72,14 @@
<view class="index-cet-tt-rg"> <view class="index-cet-tt-rg">
{{contractInfo.area}} {{contractInfo.area}}
</view> </view>
</view>
<view class="index-cet-tt" v-if="contractStatus != 1 && contractStatus != 2 && contractStatus != 3 && contractStatus != 4">
<view class="index-cet-tt-lf">
优惠券:
</view>
<view class="index-cet-tt-rg">
-{{contractInfo.discountPrice||0}}
</view>
</view> </view>
<view class="index-cet-tt"> <view class="index-cet-tt">
<view class="index-cet-tt-lf"> <view class="index-cet-tt-lf">
......
...@@ -149,7 +149,9 @@ ...@@ -149,7 +149,9 @@
async getDetailData(forumId) { async getDetailData(forumId) {
const res = await detailForumItemById(forumId) const res = await detailForumItemById(forumId)
this.imgs = res.data.imgs.split(',') if(res.data.imgs){
this.imgs = res.data.imgs.split(',')
}
this.detailData = res.data this.detailData = res.data
this.getCommentList() this.getCommentList()
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="index-cent"> <view class="index-cent">
<!-- @click="handleCompanyDetail" --> <!-- @click="handleCompanyDetail" -->
<view class="index-cent-top"> <view class="index-cent-top">
<view class="d-flex a-center j-sb" @click="handleCompanyDetail"> <view class="d-flex a-center j-sb" >
<view class="index-cent-top-name"> <view class="index-cent-top-name">
{{businessInfo.businessName}} {{businessInfo.businessName}}
</view> </view>
...@@ -79,14 +79,20 @@ ...@@ -79,14 +79,20 @@
</view> --> </view> -->
<!-- 商家介绍模块 --> <!-- 商家介绍模块 -->
<view v-if="currentChecked == 0"> <view v-if="currentChecked == 0">
<view class="" v-html="cent"> </view> <!-- <view class="" v-html="cent"> </view> -->
<view class="title-txt">
{{businessInfo.businessIntroduce}}
</view>
<view class="introduce">
<image :src="item.url" mode="widthFix" v-for="(item,index) in img" :key="index"></image>
</view>
</view> </view>
<!-- 商家动态模块 --> <!-- 商家动态模块 -->
<view v-else-if="currentChecked == 1"> <view v-else-if="currentChecked == 1">
<template v-if="forumList.length"> <template v-if="forumList.length">
<view class="distence" v-for="(item,index) in forumList" :key="index" <view class="distence" v-for="(item,index) in forumList" :key="index"
@click="handleDetail(item.forumId)"> @click="handleDetail(item.forumId)">
<dynamicList :itemDetail="item" :isDelete='true' @refersh="handleRefersh"></dynamicList> <dynamicList :itemDetail="item" :isDelete='false' @refersh="handleRefersh"></dynamicList>
</view> </view>
</template> </template>
<u-empty v-else marginTop="20" width="260" height="260" textSize="26" mode="data" <u-empty v-else marginTop="20" width="260" height="260" textSize="26" mode="data"
...@@ -138,7 +144,7 @@ ...@@ -138,7 +144,7 @@
</view> </view>
</template> </template>
<script> <script>
import tabsList from '@/components/custom/tabs.vue' import tabsList from '@/components/custom/tabs.vue'
import dynamicList from '@/components/custom/dynamic.vue' import dynamicList from '@/components/custom/dynamic.vue'
...@@ -189,7 +195,8 @@ ...@@ -189,7 +195,8 @@
forumList: [], forumList: [],
total: 0, total: 0,
evalList: [], evalList: [],
replyData: {} replyData: {},
img:[]
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -332,6 +339,9 @@ ...@@ -332,6 +339,9 @@
this.businessInfo = res.data this.businessInfo = res.data
this.businessInfo.url = JSON.parse(res.data.businessImg)[0].url this.businessInfo.url = JSON.parse(res.data.businessImg)[0].url
this.cent = this.$utilsMethods.replaceSpecialChar(res.data.businessIntroduce) this.cent = this.$utilsMethods.replaceSpecialChar(res.data.businessIntroduce)
if(res.data.businessImg){
this.img = JSON.parse(res.data.businessImg)
}
}) })
}, },
...@@ -365,7 +375,6 @@ ...@@ -365,7 +375,6 @@
//查看地址 //查看地址
btnAddress(item) { btnAddress(item) {
console.log(this.businessInfo,"=================")
uni.openLocation({ uni.openLocation({
latitude: parseFloat(this.businessInfo.dimension), latitude: parseFloat(this.businessInfo.dimension),
longitude: parseFloat(this.businessInfo.longitude ), longitude: parseFloat(this.businessInfo.longitude ),
...@@ -523,4 +532,17 @@ ...@@ -523,4 +532,17 @@
height: 36rpx; height: 36rpx;
margin-left: 16rpx; margin-left: 16rpx;
} }
.title-txt{
font-size: 26rpx;
color: #666666;
line-height: 1.5;
margin-bottom: 20rpx;
padding-top: 20rpx;
}
.introduce{
>image{
width: 100%;
}
}
</style> </style>
\ No newline at end of file
<template> <template>
<view> <view>
<u-sticky bgColor="#ffff" offset-top="0"> <!-- <u-sticky bgColor="#ffff" offset-top="0"> -->
<com-navbar :homeShow="false" bgColor='#F7F8FA' title=" "
:titleStyle="{fontSize: '36rpx' , color: '#000000'}"></com-navbar>
<view class="index"> <view class="index">
<image class="logo" src="@/static/images/headImage.png"></image> <image class="logo" src="@/static/images/headImage.png"></image>
<view :style="{ height: `calc(${globalData.navBarHeightRpx}rpx )` }"></view> <view :style="{ height: `calc(${globalData.navBarHeightRpx}rpx )` }"></view>
<view class="index-header d-flex j-sb a-center"> <view class="index-header j-sb a-center">
<view class="d-flex a-center" @click="handleLook"> <!-- @click="handleLook" -->
<image @click.stop="handlePreview" class="index-header-avatar" <view class="d-flex a-center" style="justify-content: space-between;">
:src="clientInfo.avatar" <!-- @click.stop="handlePreview" -->
mode=""> <view class="d-flex a-center">
</image> <image class="index-header-avatar" :src="clientInfo.avatar" mode="">
<view class="index-header-info"> </image>
<view class="index-header-info-name">{{clientInfo.nickName}}</view> <view class="index-header-info">
<view class="index-header-info-phone">{{clientInfo.userName}}</view> <view class="index-header-info-name">{{clientInfo.nickName}}</view>
<view class="index-header-info-phone">{{clientInfo.userName}}</view>
</view>
</view> </view>
<view class="index-header-gz" @click="handleLook">
{{ clientInfo.isFavorites?'已关注':'关注'}}
</view>
</view> </view>
<view class="list_cen d-flex a-center">
<view class="list_cen_item">
<view class="list_item">
{{ clientInfo.attentionNum||0}}
</view>
<view class="list_txt">
关注
</view>
</view>
<view class="list_cen_item">
<view class="list_item">
{{ clientInfo.fansNum||0}}
</view>
<view class="list_txt">
粉丝
</view>
</view>
<view class="list_cen_item">
<view class="list_item">
{{ clientInfo.bePraisedNum||0}}
</view>
<view class="list_txt">
获赞
</view>
</view>
<view class="list_cen_item">
<view class="list_item">
{{ clientInfo.collectNum||0}}
</view>
<view class="list_txt">
收藏
</view>
</view>
</view>
</view> </view>
</view> </view>
<view class="px-three"> <view class="px-three">
<tabsList :list="tabsOptions" :checked="currentChecked" @change="handleChangeTab"></tabsList> <tabsList :list="tabsOptions" :checked="currentChecked" @change="handleChangeTab"></tabsList>
</view> </view>
</u-sticky> <!-- </u-sticky> -->
<view class="px-three" style="padding-bottom: 60rpx;"> <view class="px-three" style="padding-bottom: 60rpx;">
<template v-if="currentChecked == 0"> <template v-if="currentChecked == 0">
<view v-for="(item,index) in demandList" :key="index"> <view v-for="(item,index) in demandList" :key="index">
...@@ -30,7 +72,7 @@ ...@@ -30,7 +72,7 @@
<template v-else> <template v-else>
<view class="distence" v-for="(item,index) in forumList" :key="index" @click="handleDetail(item.forumId)"> <view class="distence" v-for="(item,index) in forumList" :key="index" @click="handleDetail(item.forumId)">
<!-- <dynamicList></dynamicList> --> <!-- <dynamicList></dynamicList> -->
<dynamicList :itemDetail="item"></dynamicList> <dynamicList :itemDetail="item" :type='1' @refersh='handleRefersh'></dynamicList>
</view> </view>
</template> </template>
</view> </view>
...@@ -40,11 +82,13 @@ ...@@ -40,11 +82,13 @@
<script> <script>
import tabsList from '@/components/custom/tabs.vue' import tabsList from '@/components/custom/tabs.vue'
import comDemandList from '@/components/custom/demand.vue' import comDemandList from '@/components/custom/demand.vue'
import dynamicList from '@/components/custom/dynamic.vue' // import dynamicList from '@/components/custom/dynamic.vue'
import dynamicList from '@/components/custom/dynamics.vue'
import { import {
getUserInfoById, getUserInfoById,
listClientDemandGET, listClientDemandGET,
listForumGET listForumGET,
collectOrUncollect
} from '@/api/workbench/index.js'; } from '@/api/workbench/index.js';
export default { export default {
components: { components: {
...@@ -102,7 +146,7 @@ ...@@ -102,7 +146,7 @@
// 动态详情 // 动态详情
handleDetail(forumId) { handleDetail(forumId) {
uni.navigateTo({ uni.navigateTo({
url: `./dynamicDetail?forumId=${forumId}&forumType=invitation` url: `./forumDetails?forumId=${forumId}&forumType=invitation`
}) })
}, },
// 获取需求列表 // 获取需求列表
...@@ -114,9 +158,34 @@ ...@@ -114,9 +158,34 @@
}, },
async getForumList(){ async getForumList(){
const res = await listForumGET(this.forumParams) const res = await listForumGET(this.forumParams)
res.rows.forEach((item, index) => {
if(item.imgs){
item.imgs = item.imgs.split(',')
}
})
this.forumList = res.rows this.forumList = res.rows
this.forumTotal = res.total this.forumTotal = res.total
}, },
//关注
handleLook(){
collectOrUncollect({
forumId: this.clientInfo.userId,
userId: this.userInfot.userId,
isFavoritesType: 2, // 论坛1商家2
favoriteType: 'merchant'
}).then(res => {
uni.showToast({
title: '成功!',
icon: 'none'
})
this.getUserInfo(this.clientInfo.userId)
})
},
handleRefersh(){
this.forumList=[]
this.getForumList()
}
} }
} }
...@@ -129,30 +198,49 @@ ...@@ -129,30 +198,49 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.logo { .logo {
width: 100%; width: 100%;
height: 332rpx; height: 462rpx;
position: absolute; position: absolute;
z-index: -1; z-index: -1;
top: 0%; top: 0%;
left: 0%; left: 0%;
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
} }
.sticky { .sticky {
width: 100%; width: 100%;
// padding: 16rpx 40rpx 20rpx; // padding: 16rpx 40rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.list_cen {
padding-top: 50rpx;
.list_cen_item{
flex: 1;
text-align: center;
.list_item{
font-size: 36rpx;
color: #FFFFFF;
}
.list_txt{
font-size: 28rpx;
color: rgba(255,255,255,0.8);
padding-top: 10rpx;
}
}
}
.index { .index {
height: 332rpx; height: 462rpx;
position: relative; position: relative;
&-header { &-header {
width: 100%; width: 100%;
position: absolute; position: absolute;
bottom: 40rpx; bottom: 60rpx;
padding: 0 40rpx; padding: 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
&-avatar { &-avatar {
width: 110rpx; width: 110rpx;
height: 110rpx; height: 110rpx;
...@@ -160,29 +248,40 @@ ...@@ -160,29 +248,40 @@
border: 4rpx solid rgba(255, 255, 255, 0.9); border: 4rpx solid rgba(255, 255, 255, 0.9);
border-radius: 50%; border-radius: 50%;
} }
&-info { &-info {
margin-left: 20rpx; margin-left: 20rpx;
&-name { &-name {
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
} }
&-phone { &-phone {
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
margin-top: 12rpx; margin-top: 12rpx;
} }
}
&-gz{
width: 116rpx;
height: 52rpx;
background: #4BA1FF;
border-radius: 52rpx;
font-size: 23rpx;
color: #FFFFFF;
text-align: center;
line-height: 52rpx;
} }
} }
} }
.distence { .distence {
margin-bottom: 60rpx; margin-bottom: 60rpx;
} }
.distence:first-child { .distence:first-child {
margin-top: 20rpx; margin-top: 20rpx;
} }
......
<template>
<view class="index">
<u-sticky bgColor='#F7F8FA'>
<u-tabs :list="list1" @click="followClick" :scrollable="false" :activeStyle="{
color: '#242424',
fontSize:'32rpx',
transform:'scale(1.05)',
}"></u-tabs>
</u-sticky>
<template v-if="followList.length">
<view class="list d-flex a-center" v-for="(item, index) in followList" :key="index" @click="clickfollow(item.userType,item.userId)">
<view class="list_lf d-flex a-center">
<u--image :showLoading="true" :src="item.avatar" radius='100%' width="80rpx" height="80rpx"
class="list_img"></u--image>
<view class="list_name">
{{item.nickName}}
</view>
</view>
<view class="list_lr">
<view class="list_btn" >
已关注
</view>
</view>
</view>
</template>
<u-empty v-else marginTop="200" width="260" height="260" textSize="26" mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</template>
<script>
import {
getattentionGET
} from '@/api/workbench/index.js'
export default {
data() {
return {
list1: [{
name: '用户',
userType: "app_user"
}, {
name: '商家',
userType: "merchant"
}],
followList: [],
queryParams: {
pageNum: 1,
pageSize: 15,
userType: "app_user"
},
}
},
onLoad() {
this.getList()
},
onReachBottom() {
if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) return
this.queryParams.pageNum++
this.getList()
},
methods: {
followClick(e) {
this.queryParams.userType = e.userType
this.queryParams.pageNum = 1
this.followList = []
this.getList()
},
//关注列表
async getList() {
const res = await getattentionGET(this.queryParams)
this.followList = [...this.followList, ...res.data]
console.log(this.followList, "====================")
this.total = res.total
},
//去详情
clickfollow(type,id){
console.log(type,"=====")
let self = this
if(type=='merchant'){
//商家
self.$uniGo.navigateTo({
url: `/homePage/merchant/index?businessId=${id}`
});
}else{
//用户
uni.navigateTo({
url: `/homePage/merchant/personHomePage?userId=${id}`
})
}
}
}
}
</script>
<style lang="scss" scoped>
.index {
padding: 0rpx 30rpx 30rpx 30rpx;
.list {
background: #fff;
border-radius: 24rpx;
padding: 20rpx;
justify-content: space-between;
margin: 10rpx 0;
.list_lf {
.list_name {
font-size: 28rpx;
color: #333333;
padding-left: 20rpx;
}
}
.list_lr {
.list_btn {
width: 108rpx;
height: 42rpx;
border-radius: 8rpx;
border: 1rpx solid #1572FF;
font-size: 22rpx;
color: #1572FF;
text-align: center;
line-height: 42rpx;
}
}
}
}
</style>
\ No newline at end of file
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
</view> </view>
</u-sticky> </u-sticky>
<view class="px-three pb-four"> <view class="px-three pb-four" :class="currentChecked == 0?'active' :''">
<template v-if="currentChecked == 0"> <template v-if="currentChecked == 0">
<template v-if="collectList.length"> <template v-if="collectList.length">
<view class="conntainer" v-for="(item,index) in collectList" :key="index" @click="handleDetail(item)"> <view class="conntainer conntainer1" v-for="(item,index) in collectList" :key="index" @click="handleDetail(item)">
<dynamicList :showAuthor="true" :itemDetail="item" :showState="false"></dynamicList> <dynamicList :showAuthor="true" :itemDetail="item" :showState="false"></dynamicList>
</view> </view>
</template> </template>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
listBeCollectedGet listBeCollectedGet
} from '@/api/workbench/index.js' } from '@/api/workbench/index.js'
import tabsList from '@/components/custom/tabs.vue' import tabsList from '@/components/custom/tabs.vue'
import dynamicList from '@/components/custom/dynamic.vue' import dynamicList from '@/components/custom/dynamics.vue'
import articleList from './components/articleList.vue' import articleList from './components/articleList.vue'
export default { export default {
components: { components: {
...@@ -92,6 +92,11 @@ ...@@ -92,6 +92,11 @@
methods: { methods: {
async getCollectList() { async getCollectList() {
const res = await listCollectGet(this.queryParams) const res = await listCollectGet(this.queryParams)
res.rows.forEach((item, index) => {
if(item.imgs){
item.imgs = item.imgs.split(',')
}
})
this.total = res.total this.total = res.total
this.collectList = [...this.collectList,...res.rows] this.collectList = [...this.collectList,...res.rows]
}, },
...@@ -119,19 +124,42 @@ ...@@ -119,19 +124,42 @@
}, },
// 动态详情 // 动态详情
handleDetail(row) { handleDetail(row) {
uni.navigateTo({ // uni.navigateTo({
url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}` // url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}`
}) // })
if(row.forumType=='dynamic'){
uni.navigateTo({
url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}`
})
}else if(row.forumType=='invitation'){
uni.navigateTo({
url: `/homePage/merchant/forumDetails?forumId=${row.forumId}&forumType=${row.forumType}`
})
}
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.active {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.conntainer1 {
width: 48%;
padding: 0;
}
/deep/.u-empty{
width: 100%;
}
}
.conntainer { .conntainer {
background: #fff; background: #fff;
padding: 26rpx 24rpx; padding: 26rpx 24rpx;
margin-top: 20rpx; margin-top: 20rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>
\ No newline at end of file
...@@ -107,12 +107,14 @@ ...@@ -107,12 +107,14 @@
}, },
handleChangeTab(val) { handleChangeTab(val) {
this.currentChecked = val this.currentChecked = val
this.reset() // this.reset()
if (this.currentChecked == 0) { if (this.currentChecked == 0) {
this.isComment = true this.isComment = true
this.commentList = []
this.getCommentList() this.getCommentList()
} else if (this.currentChecked == 1) { } else if (this.currentChecked == 1) {
this.isComment = false this.isComment = false
this.commentList = []
this.getBeCommented() this.getBeCommented()
} else { } else {
this.isComment = true this.isComment = true
...@@ -126,9 +128,19 @@ ...@@ -126,9 +128,19 @@
// 动态详情 // 动态详情
handleDetail(row) { handleDetail(row) {
console.log(row, 'row===') console.log(row, 'row===')
if (this.currentChecked == 1) { // if (this.currentChecked == 1) {
// uni.navigateTo({
// url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}`
// })
// }
if(row.forumType=="comment"){
uni.navigateTo({ uni.navigateTo({
url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}` url: `/homePage/merchant/index?businessId=${row.forumId}`
})
}else{
uni.navigateTo({
url: `/homePage/merchant/forumDetails?forumId=${row.forumId}&forumType=${row.forumType}`
}) })
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="px-three pb-four"> <view class="px-three pb-four">
<template> <template>
<view class="conntainer" v-for="(item,index) in forumList" :key="index" <view class="conntainer" v-for="(item,index) in forumList" :key="index"
@click="handleDetail(item.forumId)"> @click="handleDetail(item.userId)">
<dynamicList :itemDetail="item" :showAuthor="true" :isDelete="true" :isEdit="true" @delete="handleDelete" @edit="handleEdit"> <dynamicList :itemDetail="item" :showAuthor="true" :isDelete="true" :isEdit="true" @delete="handleDelete" @edit="handleEdit">
</dynamicList> </dynamicList>
</view> </view>
...@@ -92,16 +92,11 @@ ...@@ -92,16 +92,11 @@
}, },
// 动态详情 // 动态详情
handleDetail(forumId) { handleDetail(userId) {
if(this.queryParams.forumType=='dynamic'){
uni.navigateTo({ uni.navigateTo({
url: `/homePage/merchant/dynamicDetail?forumId=${forumId}&forumType=${this.queryParams.forumType}` url: `/homePage/merchant/index?businessId=${userId}&forumType=${this.queryParams.forumType}`
}) })
}else{
uni.navigateTo({
url: `/homePage/merchant/forumDetails?forumId=${forumId}&forumType=${this.queryParams.forumType}`
})
}
} }
} }
} }
......
...@@ -124,10 +124,16 @@ ...@@ -124,10 +124,16 @@
handleDetail(row) { handleDetail(row) {
console.log(row, 'row=========') console.log(row, 'row=========')
if (row.forumType == 'comment') return if (row.forumType == 'comment') return
uni.navigateTo({ if(row.forumType=='dynamic'){
url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}` uni.navigateTo({
}) url: `/homePage/merchant/dynamicDetail?forumId=${row.forumId}&forumType=${row.forumType}`
}, })
}else if(row.forumType=='invitation'){
uni.navigateTo({
url: `/homePage/merchant/forumDetails?forumId=${row.forumId}&forumType=${row.forumType}`
})
}
}
} }
} }
</script> </script>
......
<template> <template>
<view class="index"> <view class="index">
<view class="">
<u-sticky bgColor="#fff">
<u-tabs :list="list1" :scrollable='false' @click="clikeTab"></u-tabs>
</u-sticky>
</view>
<view class="index-img"> <view class="index-img">
<!-- <image style="width: 100%;height: 100%;" src="../../static/logo.png" mode=""></image> --> <!-- <image style="width: 100%;height: 100%;" src="../../static/logo.png" mode=""></image> -->
<template> <template>
...@@ -40,8 +45,15 @@ ...@@ -40,8 +45,15 @@
screenWidth: '', screenWidth: '',
lefWidth: '', lefWidth: '',
topHeig: '', topHeig: '',
downFile:'', //downFile:'',
userInfo:{} userInfo:{},
list1:[{
name: '邀请用户',
},
{
name: '邀请商家',
}
]
}; };
}, },
onShareAppMessage() { // 分享到微信好友 onShareAppMessage() { // 分享到微信好友
...@@ -61,16 +73,41 @@ ...@@ -61,16 +73,41 @@
console.log(this.screenHeight, this.screenWidth, this.lefWidth, this.topHeig, 'screen_height'); console.log(this.screenHeight, this.screenWidth, this.lefWidth, this.topHeig, 'screen_height');
this.myPoster() this.myPoster()
}, },
methods: { methods: {
// tab
clikeTab(e){
console.log(e)
if(e.index=='0'){
//用户
this.myPoster()
}else{
//商家
this.myPosterSj()
}
},
//用户
myPoster() { myPoster() {
myPosterSjGET().then((res) => { myPosterGET().then((res) => {
uni.showLoading({ uni.showLoading({
title:'加载中' title:'加载中',
mask:true
}) })
this.listBy(res.data.posterContentTwo) this.listBy(res.data.posterContent)
this.getImage(res.data.qrCode) this.getImage(res.data.qrCode)
}) })
}, },
//商家
myPosterSj() {
myPosterSjGET().then((res) => {
uni.showLoading({
title:'加载中',
mask:true
})
this.listBy(res.data.posterContentTwo)
this.getImage(res.data.qrCode)
})
},
listBy(posterContent) { listBy(posterContent) {
listByIds(posterContent).then((res) => { listByIds(posterContent).then((res) => {
this.getImageInfo(res.data[0].url) this.getImageInfo(res.data[0].url)
...@@ -107,17 +144,19 @@ ...@@ -107,17 +144,19 @@
ctx.drawImage(that.imgpath, this.lefWidth, this.topHeig, 150, 150); ctx.drawImage(that.imgpath, this.lefWidth, this.topHeig, 150, 150);
// 完成绘制,将结果导出为图片 // 完成绘制,将结果导出为图片
ctx.draw(); // true表示导出时使用canvas的宽高,不进行缩放 ctx.draw(); // true表示导出时使用canvas的宽高,不进行缩放
uni.hideLoading() uni.hideLoading ()
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
success: function(res) { success: function(res) {
console.log('合并后的图片路径:', res.tempFilePath); console.log('合并后的图片路径:', res.tempFilePath);
that.setData(res.tempFilePath) setTimeout(()=>{
that.setDatas(res.tempFilePath)
},500)
// 在这里你可以将合并后的图片保存到本地或进行其他处理 // 在这里你可以将合并后的图片保存到本地或进行其他处理
} }
}); });
}, },
setData(v) { setDatas(v) {
this.downFile = v this.downFile = v
// console.log(v, '11111111111111222222') // console.log(v, '11111111111111222222')
// this.parth.push(v) // this.parth.push(v)
......
...@@ -146,8 +146,10 @@ ...@@ -146,8 +146,10 @@
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
success: function(res) { success: function(res) {
console.log('合并后的图片路径:', res.tempFilePath); console.log('合并后的图片路径:', res.tempFilePath);
that.setData(res.tempFilePath) setTimeout(()=>{
that.setDatas(res.tempFilePath)
},500)
// 在这里你可以将合并后的图片保存到本地或进行其他处理 // 在这里你可以将合并后的图片保存到本地或进行其他处理
} }
}); });
......
...@@ -407,6 +407,12 @@ ...@@ -407,6 +407,12 @@
"style": { "style": {
"navigationBarTitleText": "收藏商家" "navigationBarTitleText": "收藏商家"
} }
},
{
"path": "attention/index",
"style": {
"navigationBarTitleText": "我的关注"
}
} }
] ]
} }
......
...@@ -372,12 +372,13 @@ ...@@ -372,12 +372,13 @@
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/contract/merchant/index?contractId=${v.contractId}` url: `/contract/merchant/index?contractId=${v.contractId}`
}); });
} else { }
// 跳转 -- 用户 // else {
this.$uniGo.navigateTo({ // // 跳转 -- 用户
url: `/contract/index/index?contractId=${v.contractId}` // this.$uniGo.navigateTo({
}); // url: `/contract/index/index?contractId=${v.contractId}`
} // });
// }
}, },
} }
}; };
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view class="px-three pb-four list" v-if="forumList.length"> <view class="px-three pb-four list" v-if="forumList.length">
<view class="conntainer" v-for="(item,index) in forumList" :key="index" @click="handleDetail(item.forumId)"> <view class="conntainer" v-for="(item,index) in forumList" :key="index" @click="handleDetail(item.forumId)">
<dynamicLists :itemDetail="item"></dynamicLists> <dynamicLists :itemDetail="item" @refersh="handleRefersh"></dynamicLists>
</view> </view>
</view> </view>
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/forum/publish?forumType=invitation' url: '/pages/forum/publish?forumType=invitation'
}) })
}, },
//刷新数据 //刷新数据
handleRefersh() { handleRefersh() {
......
...@@ -165,9 +165,22 @@ ...@@ -165,9 +165,22 @@
}, },
//预览 //预览
handlePreview(){ handlePreview(){
// console.log(this.model,"================") console.log(this.model,"================")
if(this.model.content==''&&this.model.imgs==''&&this.model.forumTitle=='')return
this.$set(this.model, 'imgs', this.imgs) this.$set(this.model, 'imgs', this.imgs)
if(this.model.forumTitle==''||this.model.forumTitle==undefined ){
uni.$u.toast('请填写标题')
return
}
if(this.imgs==''||this.imgs==undefined ){
uni.$u.toast('请填写上传图片')
return
}
if(this.model.content==''||this.model.content==undefined ){
uni.$u.toast('请填写正文')
return
}
let data = JSON.stringify(this.model) let data = JSON.stringify(this.model)
uni.navigateTo({ uni.navigateTo({
url:"/homePage/merchant/preview?itemdata="+data url:"/homePage/merchant/preview?itemdata="+data
......
...@@ -128,10 +128,15 @@ ...@@ -128,10 +128,15 @@
img: 'wdxq.png', img: 'wdxq.png',
id: 8 id: 8
}, },
// {
// name: '收藏商家',
// img: 'scsj.png',
// id: 9
// },
{ {
name: '收藏商家', name: '我的关注',
img: 'scsj.png', img: 'follow.png',
id: 9 id: 11
}, },
{ {
name: '邀请海报', name: '邀请海报',
...@@ -251,6 +256,11 @@ ...@@ -251,6 +256,11 @@
url: `/my/collectMerchant/index` url: `/my/collectMerchant/index`
}); });
break; break;
case 11: //我的关注
self.$uniGo.navigateTo({
url: `/my/attention/index`
});
break;
} }
}, },
// 退出 // 退出
......
...@@ -144,7 +144,8 @@ ...@@ -144,7 +144,8 @@
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #303030; color: #303030;
padding: 8rpx 0rpx 12rpx; padding: 8rpx 0rpx 12rpx;
flex: 1;
&-tit { &-tit {
font-weight: 600; font-weight: 600;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 员工端 首页 --> <!-- 员工端 首页 -->
<u-sticky bgColor="#F7F8FA" offset-top="0"> <u-sticky bgColor="#F7F8FA" offset-top="0">
<view class="index"> <view class="index">
<image class="header" src="@/static/headImage.png" mode=""></image> <image class="header" src="@/static/images/headImage.png" mode=""></image>
<com-navbar :leftIcon="false" title=" " bgColor="transparent" :titleStyle="{ <com-navbar :leftIcon="false" title=" " bgColor="transparent" :titleStyle="{
scrollTopHeader:scrollTopHeader scrollTopHeader:scrollTopHeader
}"></com-navbar> }"></com-navbar>
......
<template> <template>
<view class=""> <view class="">
<view class="index"> <view class="index">
<view class="index-matter"> <view class="index-matter">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm" labelWidth='190rpx' <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm" labelWidth='190rpx'
:labelStyle="{ :labelStyle="{
'margin-bottom':'10rpx', 'margin-bottom':'10rpx',
'font-weight': '400', 'font-weight': '400',
'font-size': '28rpx', 'font-size': '28rpx',
'color': '#333333' 'color': '#333333'
}"> }">
<u-form-item label="头像" borderBottom ref="item1"> <u-form-item label="头像" borderBottom ref="item1">
<view class="tx"> <view class="tx">
<button class="btn" open-type="chooseAvatar" @chooseavatar='chooseAvatar'> <button class="btn" open-type="chooseAvatar" @chooseavatar='chooseAvatar'>
<image style="width: 72rpx;height: 72rpx;border-radius: 50%;" :src="model1.avatar" <image style="width: 72rpx;height: 72rpx;border-radius: 50%;" :src="model1.avatar"
mode=""> mode="">
</image> </image>
</button> </button>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image>
</view>
</u-form-item>
<u-form-item label="昵称" borderBottom ref="item1">
<view class="tx">
<u--input v-model="model1.nickName" placeholder="请输入" border="none"
inputAlign='right'></u--input>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image>
</view>
</u-form-item>
<u-form-item label="手机号" borderBottom ref="item1">
<view class="tx">
<u--input v-model="model1.phonenumber" placeholder="请输入" border="none"
inputAlign='right' maxlength='11'></u--input>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> <image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="商家名称" borderBottom ref="item1"> <u-form-item label="昵称" borderBottom ref="item1">
<view class="tx"> <view class="tx">
<u--input v-model="model1.businessName" placeholder="请输入" border="none" <u--input v-model="model1.nickName" placeholder="请输入" border="none"
inputAlign='right'></u--input> inputAlign='right'></u--input>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> <image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image>
</view> </view>
</u-form-item>
<u-form-item label="公司名称" borderBottom ref="item1"> </u-form-item>
<view class="tx"> <u-form-item label="手机号" ref="item1">
<u--input v-model="model1.companyName" placeholder="请输入" border="none" <view class="tx">
inputAlign='right'></u--input> <u--input v-model="model1.phonenumber" placeholder="请输入" border="none" inputAlign='right'
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> maxlength='11' type='number'></u--input>
</view> <image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image>
</u-form-item> </view>
<u-form-item label="营业地址" borderBottom ref="item1"> </u-form-item>
<view class="tx" @click="chooseLoca"> </u--form>
<u--input disabled v-model="model1.businessAddressContent" placeholder="请输入" border="none" </view>
inputAlign='right'></u--input>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> <view class="index-cetn">
</view> <view class="">
</u-form-item> <view class="tit">
<u-form-item label="详细地址" borderBottom ref="item1"> 商家名称
<view class="tx"> </view>
<u--input v-model="model1.businessAddressInfo" placeholder="请输入" border="none" <view class="tx">
inputAlign='right'></u--input> <u--input v-model="model1.businessName" placeholder="请输入" border="none" inputAlign='left'
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> :customStyle="cty"></u--input>
</view> </view>
</u-form-item> </view>
<u-form-item label="法人姓名" borderBottom ref="item1">
<view class="tx"> <view class="">
<u--input v-model="model1.corporationName" placeholder="请输入" border="none" <view class="tit">
inputAlign='right'></u--input> 公司名称
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> </view>
</view> <view class="tx">
</u-form-item> <u--input v-model="model1.companyName" placeholder="请输入" border="none" inputAlign='left'
<u-form-item label="法人联系电话" :borderBottom="false" ref="item1"> :customStyle="cty"></u--input>
<view class="tx"> </view>
<u--input v-model="model1.corporationMobile" placeholder="请输入" border="none" </view>
inputAlign='right' type="number"></u--input> <view class="">
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> <view class="tit">
</view> 营业地址
</u-form-item> </view>
</u--form> <view class="tx" @click="chooseLoca">
</view> <u--input disabled v-model="model1.businessAddressContent" placeholder="请输入" border="none"
inputAlign='left' :customStyle="cty"></u--input>
<view class="index-cetn"> </view>
<view class="index-cetn-tit"> </view>
收款账户
</view> <view class="">
<view class="" <view class="tit">
style="display: flex;align-items: center;justify-content: space-between;padding: 40rpx 0 50rpx;"> 详细地址
<view class="tit"> </view>
开户行 <view class="tx">
</view> <u--input v-model="model1.businessAddressInfo" placeholder="请输入" border="none" inputAlign='left'
<view class="tx"> :customStyle="cty"></u--input>
<u--input v-model="model1.bank" placeholder="请输入" border="none" inputAlign='right'></u--input> </view>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> </view>
</view>
</view> <view class="">
<view class="xin"></view> <view class="tit">
<view class="" 法人姓名
style="display: flex;align-items: center;justify-content: space-between;padding: 40rpx 0 50rpx;"> </view>
<view class="tit"> <view class="tx">
银行卡号 <u--input v-model="model1.corporationName" placeholder="请输入" border="none" inputAlign='left'
</view> :customStyle="cty"></u--input>
<view class="tx"> </view>
<u--input type="number" v-model="model1.bankNumber" placeholder="请输入" border="none" </view>
inputAlign='right'></u--input>
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> <view class="">
</view> <view class="tit">
</view> 法人联系电话
<view class="tit" style="margin-bottom: 10rpx;"> </view>
营业执照 <view class="tx">
</view> <u--input v-model="model1.corporationMobile" placeholder="请输入" border="none" inputAlign='left'
<com-upload ref="license" :register="true" imgType="takePictures" @changeList="changeList"></com-upload> :customStyle="cty"></u--input>
<view class="tit" style="margin-bottom: 10rpx;"> </view>
商家头像 </view>
</view>
<com-upload :maxCount="1" :register="true" ref="business" imgType="takePictures" @changeList="changeLists"></com-upload> </view>
<view class="index-cetn">
<view class="index-cetn-tit">
收款账户
</view>
<view class="">
<view class="tit">
开户行
</view>
<view class="tx">
<u--input v-model="model1.bank" placeholder="请输入" border="none" inputAlign='left'
:customStyle="cty"></u--input>
<!-- <image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> -->
</view>
</view>
<!-- <view class="xin"></view> -->
<view class="">
<view class="tit">
银行卡号
</view>
<view class="tx">
<u--input type="number" v-model="model1.bankNumber" placeholder="请输入" border="none"
inputAlign='left' :customStyle="cty"></u--input>
<!-- <image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> -->
</view>
</view>
<view class="tit" style="margin-bottom: 10rpx;">
营业执照
</view>
<com-upload ref="license" :register="true" imgType="takePictures" @changeList="changeList"></com-upload>
<view class="tit" style="margin-bottom: 10rpx;">
商家头像
</view>
<com-upload :maxCount="1" :register="true" ref="business" imgType="takePictures"
@changeList="changeLists"></com-upload>
<view class="index-cetn-tit" style="margin-top: 20rpx;"> <view class="index-cetn-tit" style="margin-top: 20rpx;">
商家介绍 商家介绍
</view> </view>
<view class="com-textarea-box"> <view class="com-textarea-box">
<u--textarea autoHeight v-model="model1.businessIntroduce" class="com-textarea" placeholder="请输入" <u--textarea autoHeight v-model="model1.businessIntroduce" class="com-textarea" placeholder="请输入"
:customStyle="{ :customStyle="{
'background':'#F6F7F8', 'background':'#F6F7F8',
'font-size':'28rpx', 'font-size':'28rpx',
'fontWeight':'bold', 'fontWeight':'bold',
'color':'#333 !important', 'color':'#333 !important',
'padding':'20rpx' 'padding':'20rpx'
}" border="none"></u--textarea> }" border="none"></u--textarea>
<view class="picture"> <view class="picture">
<com-upload ref="upload" :register="true" imgType="takePictures" @changeList="changeList1"></com-upload> <com-upload ref="upload" :register="true" imgType="takePictures"
</view> @changeList="changeList1"></com-upload>
</view> </view>
</view>
</view> </view>
<!-- <view class=""> <!-- <view class="">
<jx-editor @input="input"></jx-editor> <jx-editor @input="input"></jx-editor>
</view> --> </view> -->
<view class="index-cetn"> <view class="index-cetn">
<view class="" <view class="">
style="display: flex;align-items: center;justify-content: space-between;padding: 40rpx 0 50rpx;">
<view class="tit"> <view class="tit">
登录账号 登录账号
</view> </view>
<view class="tx"> <view class="tx">
<u--input v-model="model1.userName" placeholder="请输入" border="none" inputAlign='right'></u--input> <u--input v-model="model1.userName" placeholder="请输入" border="none" inputAlign='left'
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> :customStyle="cty"></u--input>
</view> </view>
</view> </view>
<view class="xin"></view> <view class="">
<view class=""
style="display: flex;align-items: center;justify-content: space-between;padding: 40rpx 0 50rpx;">
<view class="tit"> <view class="tit">
登录密码 登录密码
</view> </view>
<view class="tx"> <view class="tx">
<u--input v-model="model1.password" type="password" placeholder="请输入" border="none" inputAlign='right'></u--input> <u--input v-model="model1.password" type="password" placeholder="请输入" border="none"
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> inputAlign='left' :customStyle="cty"></u--input>
</view> </view>
</view> </view>
<view class="xin"></view> <view class="">
<view class=""
style="display: flex;align-items: center;justify-content: space-between;padding: 40rpx 0 50rpx;">
<view class="tit"> <view class="tit">
确认密码 确认密码
</view> </view>
<view class="tx"> <view class="tx">
<u--input v-model="confirmPassword" type="password" placeholder="请输入" border="none" inputAlign='right'></u--input> <u--input v-model="confirmPassword" type="password" placeholder="请输入" border="none"
<image class="tx-jt" :src="imgBgUrl + 'yjt.png'" mode=""></image> inputAlign='left' :customStyle="cty"></u--input>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="btm"> <view class="btm">
<button type="primary" @click="jump">保存</button> <button type="primary" @click="jump">保存</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import { import {
mapGetters mapGetters
} from 'vuex'; } from 'vuex';
import { import {
orderStatisticsPOST orderStatisticsPOST
} from '@/api/upload.js'; } from '@/api/upload.js';
import { import {
userPUT, userPUT,
listByIdsGET, listByIdsGET,
merchantPOST merchantPOST
} from '@/api/workbench/index.js'; } from '@/api/workbench/index.js';
export default { export default {
data() { data() {
return { return {
active: 'https://ts1.cn.mm.bing.net/th/id/R-C.0f7e0f8f147bb9dfafc5e4c3bece59f2?rik=auXMf%2b3yZ3xMLQ&riu=http%3a%2f%2fimg.qqtouxiangzq.com%2f6%2f1182%2f32.jpg&ehk=kLA%2fNQgc8j3Poiz5Hva1NiVpJlwbSQosepCOeN5wde4%3d&risl=&pid=ImgRaw&r=0', active: 'https://ts1.cn.mm.bing.net/th/id/R-C.0f7e0f8f147bb9dfafc5e4c3bece59f2?rik=auXMf%2b3yZ3xMLQ&riu=http%3a%2f%2fimg.qqtouxiangzq.com%2f6%2f1182%2f32.jpg&ehk=kLA%2fNQgc8j3Poiz5Hva1NiVpJlwbSQosepCOeN5wde4%3d&risl=&pid=ImgRaw&r=0',
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
model1: { model1: {
userType: 'merchant', userType: 'merchant',
userId: '', userId: '',
avatar: '', avatar: '',
nickName: "", nickName: "",
phonenumber: '', phonenumber: '',
businessName: '', businessName: '',
companyName: '', companyName: '',
businessAddressContent: '', businessAddressContent: '',
businessAddressInfo: '', businessAddressInfo: '',
corporationName: '', corporationName: '',
corporationMobile: '', corporationMobile: '',
bank: '', bank: '',
bankNumber: '', bankNumber: '',
licenseImg: '', licenseImg: '',
businessImg: '', businessImg: '',
dimension: '', dimension: '',
longitude: '', longitude: '',
businessIntroduce: '', businessIntroduce: '',
password:"", //密码 password: "", //密码
userName:"", userName: "",
businessIntroduceImg:"" //商家图片 businessIntroduceImg: "" //商家图片
}, },
confirmPassword:"", //确认密码 confirmPassword: "", //确认密码
rules: {}, rules: {},
userId: '', userId: '',
spread: '', // 分享 spread: '', // 分享
}; cty: {
}, width: '630rpx',
computed: { height: '96rpx',
...mapGetters({ backgroundColor: 'rgba(143, 146, 161, 0.08)',
userInfot: 'userInfo' borderRadius: '20rpx',
}) padding: "0 20rpx"
}, }
};
},
computed: {
...mapGetters({
userInfot: 'userInfo'
})
},
onLoad(option) { onLoad(option) {
let self = this let self = this
if (option.spread) { if (option.spread) {
...@@ -244,285 +268,290 @@ ...@@ -244,285 +268,290 @@
self.spread = obj[1] self.spread = obj[1]
console.log(qrUrl, obj, self.spread, 'option===========--------1111111111112222222') console.log(qrUrl, obj, self.spread, 'option===========--------1111111111112222222')
} }
this.model1.userId = this.userInfot.userId this.model1.userId = this.userInfot.userId
this.model1.avatar = this.userInfot.avatar ? this.userInfot.avatar : this.imgBgUrl + 'mx.png' this.model1.avatar = this.userInfot.avatar ? this.userInfot.avatar : this.imgBgUrl + 'mx.png'
this.model1.nickName = this.userInfot.nickName this.model1.nickName = this.userInfot.nickName
this.model1.phonenumber = this.userInfot.phonenumber this.model1.phonenumber = this.userInfot.phonenumber
}, },
methods: { methods: {
chooseLoca() { chooseLoca() {
let self = this let self = this
console.log('位置名称:111'); console.log('位置名称:111');
uni.chooseLocation({ uni.chooseLocation({
success: function(res) { success: function(res) {
self.model1.businessAddressContent = res.address self.model1.businessAddressContent = res.address
self.model1.longitude = res.longitude self.model1.longitude = res.longitude
self.model1.dimension = res.latitude self.model1.dimension = res.latitude
console.log('位置名称:' + res.name); console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address); console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude); console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude); console.log('经度:' + res.longitude);
} }
}); });
}, },
//根据oss id 查询图片地址 //根据oss id 查询图片地址
listById() { listById() {
let self = this let self = this
listByIdsGET(self.userInfot.user.avatar).then((res) => { listByIdsGET(self.userInfot.user.avatar).then((res) => {
if (res.code == 200) { if (res.code == 200) {
self.$nextTick(() => { self.$nextTick(() => {
self.active = res.data[0].url self.active = res.data[0].url
}) })
} }
}) })
}, },
input(v) { input(v) {
this.model1.businessIntroduce = v this.model1.businessIntroduce = v
}, },
changeList(v) { changeList(v) {
this.model1.licenseImg = JSON.stringify(v) this.model1.licenseImg = JSON.stringify(v)
}, },
changeLists(v) { changeLists(v) {
this.model1.businessImg = JSON.stringify(v) this.model1.businessImg = JSON.stringify(v)
}, },
//商家图片 //商家图片
changeList1(v){ changeList1(v) {
console.log(v,"获取商家图片") console.log(v, "获取商家图片")
this.model1.businessIntroduceImg = JSON.stringify(v) this.model1.businessIntroduceImg = JSON.stringify(v)
}, },
// 保存 // 保存
jump() { jump() {
let self = this let self = this
// console.log(self.model1,self.$refs.license.fileList6, 'model1=======') // console.log(self.model1,self.$refs.license.fileList6, 'model1=======')
//手机号 phonenumber //手机号 phonenumber
//商家名称 //商家名称
if (!self.model1.businessName) { if (!self.model1.businessName) {
return uni.$u.toast('请输入商家名称'); return uni.$u.toast('请输入商家名称');
} }
//公司名称 //公司名称
if (!self.model1.companyName) { if (!self.model1.companyName) {
return uni.$u.toast('请输入公司名称'); return uni.$u.toast('请输入公司名称');
} }
//营业地址 //营业地址
if (!self.model1.businessAddressContent) { if (!self.model1.businessAddressContent) {
return uni.$u.toast('请选择营业地址'); return uni.$u.toast('请选择营业地址');
} }
//详细地址 //详细地址
if (!self.model1.businessAddressInfo) { if (!self.model1.businessAddressInfo) {
return uni.$u.toast('请输入详细地址'); return uni.$u.toast('请输入详细地址');
} }
//法人姓名 //法人姓名
if (!self.model1.corporationName) { if (!self.model1.corporationName) {
return uni.$u.toast('请输入法人姓名'); return uni.$u.toast('请输入法人姓名');
} }
//法人联系电话 //法人联系电话
if (!self.model1.corporationMobile) { if (!self.model1.corporationMobile) {
return uni.$u.toast('请输入法人联系电话'); return uni.$u.toast('请输入法人联系电话');
} }
if(!self.$utilsMethods.phoneFun(self.model1.corporationMobile)){ if (!self.$utilsMethods.phoneFun(self.model1.corporationMobile)) {
return uni.$u.toast('请输入正确的手机号') return uni.$u.toast('请输入正确的手机号')
} }
//开户行 //开户行
if (!self.model1.bank) { if (!self.model1.bank) {
return uni.$u.toast('请输入开户行'); return uni.$u.toast('请输入开户行');
} }
//银行卡号 //银行卡号
if (!self.model1.bankNumber) { if (!self.model1.bankNumber) {
return uni.$u.toast('请输入银行卡号'); return uni.$u.toast('请输入银行卡号');
} }
//营业执照 //营业执照
if (!self.model1.licenseImg) { if (!self.model1.licenseImg) {
return uni.$u.toast('请上传营业执照'); return uni.$u.toast('请上传营业执照');
} }
//商家头像 //商家头像
if (!self.model1.businessImg) { if (!self.model1.businessImg) {
return uni.$u.toast('请输入商家头像'); return uni.$u.toast('请输入商家头像');
} }
let licenseImg = JSON.parse(self.model1.licenseImg) let licenseImg = JSON.parse(self.model1.licenseImg)
licenseImg.forEach((item)=>{ licenseImg.forEach((item) => {
item.url = item.url+'?x-oss-process=image/watermark,text_5LuF6ZmQ5aSH5qGI5L2_55So' item.url = item.url + '?x-oss-process=image/watermark,text_5LuF6ZmQ5aSH5qGI5L2_55So'
}) })
self.model1.licenseImg = JSON.stringify(licenseImg) self.model1.licenseImg = JSON.stringify(licenseImg)
if(!self.model1.password){ if (!self.model1.password) {
return uni.$u.toast('请输入密码'); return uni.$u.toast('请输入密码');
} }
if(!self.confirmPassword){ if (!self.confirmPassword) {
return uni.$u.toast('请输入确认密码'); return uni.$u.toast('请输入确认密码');
} }
if(self.model1.password !== self.confirmPassword){ if (self.model1.password !== self.confirmPassword) {
return uni.$u.toast('密码和确认密码不一致'); return uni.$u.toast('密码和确认密码不一致');
} }
this.model1.spread=self.spread this.model1.spread = self.spread
// console.log(this.model1,"======================") console.log(this.model1,"======================")
merchantPOST({
...this.model1 merchantPOST({
}).then((res) => { ...this.model1
if (res.code == 200) { }).then((res) => {
uni.$u.toast('保存成功'); if (res.code == 200) {
let timer = setInterval(() => { uni.$u.toast('保存成功');
uni.reLaunch({ let timer = setInterval(() => {
url: `/pages/index/index` uni.reLaunch({
}) url: `/pages/index/index`
clearInterval(timer) })
}, 500) clearInterval(timer)
} }, 500)
}) }
})
},
// 获取头像 },
chooseAvatar(e) { // 获取头像
console.log(e); chooseAvatar(e) {
let self = this; console.log(e);
const { let self = this;
avatarUrl const {
} = e.detail; avatarUrl
this.uploadFilePromise(avatarUrl) } = e.detail;
this.active = avatarUrl this.uploadFilePromise(avatarUrl)
console.log(avatarUrl, 'this.uploadFilePromise(avatarUrl)') this.active = avatarUrl
}, console.log(avatarUrl, 'this.uploadFilePromise(avatarUrl)')
// 上传头像 },
uploadFilePromise(url) { // 上传头像
// console.log(url,'') uploadFilePromise(url) {
let token = uni.getStorageSync("token") // console.log(url,'')
return new Promise((resolve, reject) => { let token = uni.getStorageSync("token")
let a = uni.uploadFile({ return new Promise((resolve, reject) => {
url: orderStatisticsPOST, // 仅为示例,非真实的接口地址 let a = uni.uploadFile({
filePath: url, url: orderStatisticsPOST, // 仅为示例,非真实的接口地址
name: 'file', filePath: url,
formData: { name: 'file',
user: 'test', formData: {
}, user: 'test',
header: { },
'Content-Type': 'application/json;charset=UTF-8', header: {
'Authorization': `Bearer ${token}` 'Content-Type': 'application/json;charset=UTF-8',
}, 'Authorization': `Bearer ${token}`
success: ({ },
data success: ({
}) => { data
let obj = JSON.parse(data) }) => {
this.$set(this.model1, 'avatar', obj.data.url) let obj = JSON.parse(data)
console.log(this.model1.avatar, obj.data, 'this.userInfot.user') this.$set(this.model1, 'avatar', obj.data.url)
}, console.log(this.model1.avatar, obj.data, 'this.userInfot.user')
fail(error) { },
console.log('上传文件失败', error) fail(error) {
} console.log('上传文件失败', error)
}); }
}); });
}, });
} },
} }
</script> }
<style> </script>
page { <style>
background: #F7F8FA; page {
} background: #F7F8FA;
</style> }
<style scoped lang="scss"> </style>
.index { <style scoped lang="scss">
padding: 22rpx 30rpx 200rpx; .index {
padding: 22rpx 30rpx 200rpx;
&-matter {
background: #FFFFFF; &-matter {
border-radius: 18rpx; background: #FFFFFF;
padding: 28rpx 30rpx 36rpx; border-radius: 18rpx;
width: calc(100% - 60rpx); padding: 28rpx 30rpx 36rpx;
} width: calc(100% - 60rpx);
}
&-cetn {
margin-top: 20rpx; &-cetn {
background-color: #FFFFFF; margin-top: 20rpx;
border-radius: 34rpx; background-color: #FFFFFF;
padding: 40rpx 30rpx; border-radius: 34rpx;
width: calc(100% - 60rpx); padding: 40rpx 30rpx;
width: calc(100% - 60rpx);
&-tit {
font-weight: 600; &-tit {
font-size: 30rpx; font-weight: 600;
color: #333333; font-size: 30rpx;
margin-bottom: 10rpx; color: #333333;
} margin-bottom: 10rpx;
} }
} }
.tx {
display: flex;
align-items: center;
justify-content: flex-end;
&-jt {
width: 48rpx;
height: 48rpx;
}
}
.btn {
padding: 0rpx;
margin: 0rpx;
background: #fff;
width: 72rpx;
height: 72rpx;
border-radius: 50%;
}
.btm {
position: fixed;
bottom: 0;
background-color: #fff;
padding: 24rpx 60rpx 62rpx;
width: calc(100% - 120rpx);
z-index: 9;
>button {
font-size: 30rpx;
color: #FFFFFF;
height: 90rpx;
line-height: 90rpx;
background: #1572FF;
border-radius: 45rpx;
}
}
.tit {
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.nam {
font-weight: 400;
font-size: 24rpx;
color: rgba(51, 51, 51, 1);
}
.xin {
margin: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
width: 100%;
transform: scaleY(0.5);
border-color: #d6d7d9;
margin-top: 0
}
button::after {
border: none;
}
::v-deep .u-input__content__field-wrapper__field {
background-color: #FFFFFF;
}
::v-deep .u-form-item__body {
padding: 40rpx 0 50rpx !important;
} }
.com-textarea-box{ .tx {
display: flex;
align-items: center;
justify-content: flex-end;
&-jt {
width: 48rpx;
height: 48rpx;
}
}
.btn {
padding: 0rpx;
margin: 0rpx;
background: #fff;
width: 72rpx;
height: 72rpx;
border-radius: 50%;
}
.btm {
position: fixed;
bottom: 0;
background-color: #fff;
padding: 24rpx 60rpx 62rpx;
width: calc(100% - 120rpx);
z-index: 9;
>button {
font-size: 30rpx;
color: #FFFFFF;
height: 90rpx;
line-height: 90rpx;
background: #1572FF;
border-radius: 45rpx;
}
}
.tit {
font-size: 28rpx;
color: #333333;
margin: 20rpx 0;
}
.nam {
font-weight: 400;
font-size: 24rpx;
color: rgba(51, 51, 51, 1);
}
.xin {
margin: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
width: 100%;
transform: scaleY(0.5);
border-color: #d6d7d9;
margin-top: 0
}
button::after {
border: none;
}
::v-deep .u-input__content__field-wrapper__field {
//background-color: #FFFFFF;
}
::v-deep .u-form-item__body {
padding: 40rpx 0 50rpx !important;
}
.com-textarea-box {
padding-bottom: 20rpx; padding-bottom: 20rpx;
background: #F6F7F8; background: #F6F7F8;
} }
.inp {
background: red;
}
</style> </style>
\ No newline at end of file
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