Merge branch 'master' of http://122.51.230.86:3000/dianliang/dl_uniapp
# Conflicts: # pages/notice/subscribe-set.vue
This commit is contained in:
commit
fa4a0bd239
@ -9,3 +9,10 @@ export function postForkUser(params) {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
//查询城市树结构
|
||||
export function treeCity() {
|
||||
return request({
|
||||
url: '/base/city/treeCity',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
//------------------名片-----------------------
|
||||
// 查询当前登录用户的名片
|
||||
export function getUserBusiCard() {
|
||||
return request({
|
||||
@ -8,10 +9,75 @@ export function getUserBusiCard() {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 查询当前登录用户的名片
|
||||
// 获取博主名片详情
|
||||
export function getBusiCardById(params) {
|
||||
return request({
|
||||
url: '/member/busiCard/getBusiCardById',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
//提交博主名片审核申请
|
||||
export function applyBusiCard(data) {
|
||||
return request({
|
||||
url: '/member/busiCard/toApply',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//删除名片信息
|
||||
export function removeBusiCard(params) {
|
||||
return request({
|
||||
url: '/member/busiCard/remove',
|
||||
method: 'delete',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
//------------------地址-----------------------
|
||||
// 查询当前登录用户的收货地址
|
||||
export function getUserAddress() {
|
||||
return request({
|
||||
url: '/member/address/listByUser',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 博主地址选择器
|
||||
export function uniSelectList() {
|
||||
return request({
|
||||
url: '/member/address/uniSelectList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//保存地址信息
|
||||
export function saveAddress(data) {
|
||||
return request({
|
||||
url: '/member/address/save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 设置默认收货地址
|
||||
export function setDefault(params) {
|
||||
return request({
|
||||
url: '/member/address/setDefault',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
// 删除地址
|
||||
export function removeAddress(params) {
|
||||
return request({
|
||||
url: '/member/address/remove',
|
||||
method: 'delete',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
// 获取地址详细信息
|
||||
export function getById(params) {
|
||||
return request({
|
||||
url: '/member/address/getById',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
@ -18,3 +18,11 @@ export function getCatgByCode(params) {
|
||||
params:params
|
||||
})
|
||||
}
|
||||
// 根据code查分类值列表
|
||||
export function uniListByParentCode(params) {
|
||||
return request({
|
||||
url: '/base/category/uniListByParentCode',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
baseUrl: 'http://192.168.1.17:8080',
|
||||
baseUrl: 'http://192.168.1.4:8080',
|
||||
// baseUrl: 'http://localhost:8080',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
|
@ -24,7 +24,7 @@
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<uni-data-picker placeholder="请选择" popup-title="请选择收件地址" :localdata="dataTree"
|
||||
v-model="dataObj.city" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
|
||||
v-model="dataObj.cityId" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
|
||||
@popupclosed="onpopupclosed">
|
||||
</uni-data-picker>
|
||||
<textarea style="margin-top: 10rpx;" v-model="dataObj.detail" placeholder="请输入详细地址" />
|
||||
@ -39,7 +39,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field" style="align-items: center;">
|
||||
<view class="submit-box" @click="submit()">提交</view>
|
||||
<view class="submit-box" @click="submitForm()">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -47,6 +47,9 @@
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import {treeCity} from '@/api/business/base.js'
|
||||
import {saveAddress,getById} from '@/api/business/member.js'
|
||||
import {toast} from '@/utils/common.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -58,58 +61,96 @@
|
||||
text: '否',
|
||||
value: "0"
|
||||
}],
|
||||
dataTree: [{
|
||||
text: "山东省",
|
||||
value: "1",
|
||||
children: [{
|
||||
text: "济南市",
|
||||
value: "2",
|
||||
children: [{
|
||||
text: "历城区",
|
||||
value: "3",
|
||||
children: [{
|
||||
text: "华山街道",
|
||||
value: "4"
|
||||
},
|
||||
{
|
||||
text: "东风街道",
|
||||
value: "东风街道"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "历下区",
|
||||
value: "历下区"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "临沂市",
|
||||
value: "临沂市",
|
||||
children: [{
|
||||
text: "兰陵县",
|
||||
value: "兰陵县",
|
||||
children: [{
|
||||
text: "向城镇",
|
||||
value: "向城镇"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
]
|
||||
}],
|
||||
//城市树结构
|
||||
dataTree: [],
|
||||
//名片数据对象
|
||||
dataObj: {
|
||||
name: "",
|
||||
tel: "",
|
||||
city: "",
|
||||
cityId: "",
|
||||
detail: "",
|
||||
isDefault: "0"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options){
|
||||
this.initData(options.id,options.isCopy);
|
||||
},
|
||||
|
||||
onShow(options) {
|
||||
this.initAddress();
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**初始化界面*/
|
||||
initData(id,isCopy){
|
||||
if (id) {
|
||||
getById({id:id}).then(res =>{
|
||||
this.dataObj = res.data
|
||||
if (isCopy){
|
||||
this.dataObj.id = null
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.dataObj = {
|
||||
name: "",
|
||||
tel: "",
|
||||
cityId: "",
|
||||
detail: "",
|
||||
isDefault: "0"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**初始化树结构*/
|
||||
initAddress(){
|
||||
treeCity().then(res => {
|
||||
this.dataTree = res.data
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**提交*/
|
||||
submitForm(){
|
||||
if (this.dataObj.name == null || this.dataObj.name == ""){
|
||||
toast("收件人姓名不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.tel == null || this.dataObj.tel == ""){
|
||||
toast("联系电话不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.cityId == null || this.dataObj.cityId == ""){
|
||||
toast("收件地址不能为空")
|
||||
return
|
||||
}
|
||||
saveAddress(this.dataObj).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
title: '保存成功'
|
||||
});
|
||||
uni.navigateBack()
|
||||
}
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
onnodeclick(e) {
|
||||
console.log(e);
|
||||
console.log(e,135);
|
||||
},
|
||||
onpopupopened(e) {
|
||||
console.log('popupopened');
|
||||
|
@ -11,39 +11,36 @@
|
||||
size="16"></uni-icons><text>退出管理</text></view>
|
||||
</view>
|
||||
<view class="addr-list-box">
|
||||
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="onReachBottomCus" refresher-enabled
|
||||
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item,index) in dataList" class="addr-item-box">
|
||||
<view class="addr-item-top">
|
||||
<view class="item-info">
|
||||
<view class="text little-1">{{ item.city }}</view>
|
||||
<view class="text little-1">{{ item.cityName }}</view>
|
||||
<view class="text">{{ item.detail }}</view>
|
||||
<view class="text little-2 item-flex">
|
||||
{{ item.name }} {{ item.tel }}
|
||||
<view v-if="item.isDefault=='1'" class="item-icon">默认</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-opt">
|
||||
<uni-icons type="compose" color="#565656" size="16"></uni-icons><text>编辑</text>
|
||||
<view class="item-opt" @click="toEdit(item.id)">
|
||||
<uni-icons type="compose" color="#565656" size="16" ></uni-icons><text>编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addr-item-opt" v-if="ifEdit">
|
||||
<view class="opt-button choose" v-if="item.isDefault!='1'">设为默认</view>
|
||||
<view class="opt-button">复制</view>
|
||||
<view class="opt-button">删除</view>
|
||||
<view class="opt-button choose" @click="setDefaultCity(item.id)" v-if="item.isDefault!='1'">设为默认</view>
|
||||
<view class="opt-button" @click="toCopy(item.id)">复制</view>
|
||||
<view class="opt-button" @click="remove(item.id)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="dataList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getUserAddress
|
||||
getUserAddress,setDefault,removeAddress
|
||||
} from '@/api/business/member.js'
|
||||
export default {
|
||||
data() {
|
||||
@ -59,10 +56,12 @@
|
||||
dataList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
onShow() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
/**初始化数据*/
|
||||
initData() {
|
||||
getUserAddress().then(res => {
|
||||
this.dataList = res.data
|
||||
@ -74,36 +73,64 @@
|
||||
});
|
||||
})
|
||||
},
|
||||
/**设为默认方法*/
|
||||
setDefaultCity(id){
|
||||
setDefault({id:id}).then(res => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
title: '设置成功'
|
||||
});
|
||||
this.ifEdit = false
|
||||
this.initData()
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/**删除地址*/
|
||||
remove(id) {
|
||||
removeAddress({id:id}).then(res => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
title: '删除成功'
|
||||
});
|
||||
this.ifEdit = false
|
||||
this.initData()
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
/**新增页面*/
|
||||
addNew() {
|
||||
this.$tab.navigateTo(`/pages/mine/addr/addr-detail`)
|
||||
},
|
||||
/**编辑页面*/
|
||||
toEdit(id){
|
||||
this.$tab.navigateTo(`/pages/mine/addr/addr-detail?id=`+id)
|
||||
},
|
||||
|
||||
/**复制*/
|
||||
toCopy(id){
|
||||
this.$tab.navigateTo(`/pages/mine/addr/addr-detail?id=`+id+`&isCopy=1`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 进入管理
|
||||
*/
|
||||
manager(flag) {
|
||||
this.ifEdit = flag
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
|
||||
toast("没有更多数据了")
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.queryParams.pageNum++
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.queryParams.pageNum = 1
|
||||
this.total = 0
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -150,7 +177,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: start;
|
||||
|
||||
.addr-item-box {
|
||||
width: 100%;
|
||||
|
@ -12,6 +12,22 @@
|
||||
:imgCode="dataObj.platformCode"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field">
|
||||
<view class="item-lable is-required">
|
||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>平台账号
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<input class="uni-input" v-model="dataObj.accountNumber" type="text" placeholder="请输入" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field">
|
||||
<view class="item-lable is-required">
|
||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>平台昵称
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<input class="uni-input" v-model="dataObj.accountName" type="text" placeholder="请输入" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field">
|
||||
<view class="item-lable is-required">
|
||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>粉丝数
|
||||
@ -33,7 +49,9 @@
|
||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>收货地址
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<view class="choose-add" @click="chooseAddr()">请选择收货地址</view>
|
||||
<uni-data-select v-model="dataObj.addrId" :localdata="addressList"
|
||||
@change="change($event,'addrId')" :clear="false"
|
||||
:imgCode="dataObj.addrId"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field">
|
||||
@ -62,7 +80,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field" style="align-items: center;">
|
||||
<view class="submit-box">提交</view>
|
||||
<view class="submit-box" @click="submitForm">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -70,49 +88,162 @@
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import upload from '@/utils/upload'
|
||||
import {toast} from '@/utils/common.js'
|
||||
import { getBusiCardById, applyBusiCard, uniSelectList} from '@/api/business/member.js'
|
||||
import { uniListByParentCode} from '@/api/system/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//所有可选的平台
|
||||
range: [{
|
||||
value: 'xiaohongshu',
|
||||
text: "小红书"
|
||||
},
|
||||
{
|
||||
value: 'douyin',
|
||||
text: "抖音"
|
||||
}
|
||||
],
|
||||
range: [],
|
||||
sizeType: ['compressed'],
|
||||
//图片数组
|
||||
fileList: [],
|
||||
//地址集合
|
||||
addressList:[],
|
||||
//名片数据对象
|
||||
dataObj: {
|
||||
platformCode: "xiaohongshu",
|
||||
accountName:null,
|
||||
accountNumber:null,
|
||||
fansNum: null,
|
||||
tel: null
|
||||
tel: null,
|
||||
addrId:null,
|
||||
price:null,
|
||||
content:null,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options){
|
||||
this.initData(options.id)
|
||||
},
|
||||
onShow(){
|
||||
this.initAddress()
|
||||
this.initPlatForm()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
/**初始化数据*/
|
||||
initData(id){
|
||||
if (id){
|
||||
getBusiCardById({id:id}).then(res => {
|
||||
console.log(res.data,133)
|
||||
this.dataObj = res.data
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.dataObj = {
|
||||
platformCode: "xiaohongshu",
|
||||
accountName:null,
|
||||
accountNumber:null,
|
||||
fansNum: null,
|
||||
tel: null,
|
||||
addrId:null,
|
||||
price:null,
|
||||
content:null,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**初始化分类*/
|
||||
initPlatForm(){
|
||||
uniListByParentCode({code:"dl_platform"}).then(res=>{
|
||||
this.range = res.data
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/**查询当前登录用户的地址*/
|
||||
initAddress(){
|
||||
uniSelectList().then(res => {
|
||||
this.addressList = res.data
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
//改变选中值
|
||||
change(e, type) {},
|
||||
/**
|
||||
* 选择收货地址
|
||||
*/
|
||||
|
||||
/**选择收货地址*/
|
||||
chooseAddr() {
|
||||
|
||||
},
|
||||
|
||||
/**提交*/
|
||||
submitForm(){
|
||||
if (this.dataObj.platformCode == null || this.dataObj.platformCode == ""){
|
||||
toast("平台不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.accountNumber == null || this.dataObj.accountNumber == ""){
|
||||
toast("平台账号不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.accountName == null || this.dataObj.accountName == ""){
|
||||
toast("平台昵称不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.fansNum == null || this.dataObj.fansNum == ""){
|
||||
toast("粉丝数不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.tel == null || this.dataObj.tel == ""){
|
||||
toast("电话不能为空")
|
||||
return
|
||||
}
|
||||
if (this.dataObj.addrId == null || this.dataObj.addrId == ""){
|
||||
toast("收货地址不能为空")
|
||||
return
|
||||
}
|
||||
// console.log(this.fileList,'fileList')
|
||||
applyBusiCard(this.dataObj).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
title: '保存成功'
|
||||
});
|
||||
uni.navigateBack()
|
||||
}
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
afterRead(file) {
|
||||
|
||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||
upload({
|
||||
url: '',
|
||||
filePath: file.tempFilePaths[i]
|
||||
}).then((res) => {
|
||||
console.log(res,'215')
|
||||
this.fileList.push({
|
||||
url: config.baseUrl + res.data
|
||||
})
|
||||
console.log(this.fileList)
|
||||
console.log(this.fileList,'fileList')
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -13,7 +13,7 @@
|
||||
<view class="addr-list-box">
|
||||
<view class="card-dom " v-for="item in busiCardList">
|
||||
<!-- 多选框--管理状态或者选择名片时使用 -->
|
||||
<view class="choose-dom" v-if="ifEdit || ifChoose">
|
||||
<view class="choose-dom" v-if="ifChoose">
|
||||
<uni-data-checkbox v-model="item.choosed" :disabled="1!=item.approvalStatus" multiple
|
||||
:localdata="checkboxArray" />
|
||||
</view>
|
||||
@ -31,21 +31,21 @@
|
||||
<view class="card-content">
|
||||
<view class="card-person-info">
|
||||
<view class="card-name">
|
||||
<view>{{ item.nickname }}</view>
|
||||
<view>{{ item.accountName }}</view>
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
<view class="fans-dom">
|
||||
粉丝:{{ formatNumberWithUnits(item.fansNum) }}
|
||||
</view>
|
||||
<view class="nickname-dom">
|
||||
昵称:{{ item.accountName }}
|
||||
<!-- <view class="nickname-dom">-->
|
||||
<!-- 昵称:{{ item.accountName }}-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="ifEdit" @click="remove(item.id)" :class="['edit-dom',item.choosed.length>0?'':'no-choose']">删除
|
||||
</view>
|
||||
<view v-if="ifEdit" @click="del(item)" :class="['edit-dom',item.choosed.length>0?'':'no-choose']">删除
|
||||
</view>
|
||||
<view v-else :class="['edit-dom',item.choosed.length>0?'':'no-choose']" @click="edit(item)">编辑
|
||||
<view v-else :class="['edit-dom',item.choosed.length>0?'':'no-choose']" @click="edit(item.id)">编辑
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -67,15 +67,15 @@
|
||||
formatNumberWithUnits
|
||||
} from '@/utils/common.js'
|
||||
import {
|
||||
getUserBusiCard
|
||||
getUserBusiCard,removeBusiCard
|
||||
} from '@/api/business/member.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//是否是管理模式
|
||||
ifEdit: false,
|
||||
//是否是选择模式
|
||||
ifChoose: true,
|
||||
//是否是选择模式(默认值为false,管理页面)
|
||||
ifChoose: false,
|
||||
checkboxArray: [{
|
||||
text: '',
|
||||
value: true
|
||||
@ -92,7 +92,7 @@
|
||||
return this.busiCardList.filter((item) => item.choosed.length > 0).length
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
@ -105,6 +105,7 @@
|
||||
},
|
||||
//查询名片列表
|
||||
initData() {
|
||||
this.busiCardList = []
|
||||
getUserBusiCard().then(res => {
|
||||
if (res.data.length > 0) {
|
||||
res.data.map((item) => {
|
||||
@ -120,6 +121,24 @@
|
||||
});
|
||||
})
|
||||
},
|
||||
/**删除名片*/
|
||||
remove(id) {
|
||||
removeBusiCard({id:id}).then(res => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
title: '删除成功'
|
||||
});
|
||||
this.ifEdit = false
|
||||
this.initData()
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 全选
|
||||
* @param {Object} e
|
||||
@ -145,8 +164,8 @@
|
||||
*/
|
||||
del(item) {},
|
||||
//名片编辑
|
||||
edit(item) {
|
||||
this.$tab.navigateTo('/pages/mine/card/card-detail')
|
||||
edit(id) {
|
||||
this.$tab.navigateTo('/pages/mine/card/card-detail?id='+id)
|
||||
},
|
||||
addCard() {
|
||||
this.$tab.navigateTo('/pages/mine/card/card-detail')
|
||||
|
@ -11,14 +11,16 @@
|
||||
<view class="dl-person-box">
|
||||
<view class="user-image-box">
|
||||
<view class="dl-image-box">
|
||||
<image class="touxiang" src="@/static/images/profile.jpg" mode="aspectFit"></image>
|
||||
<image v-if="!userInfo.avatar" class="touxiang" src="@/static/images/profile.jpg" mode="aspectFit">
|
||||
</image>
|
||||
<image v-else class="touxiang" :src="userInfo.avatar" mode="aspectFit"></image>
|
||||
<image class="sex" src="@/static/mine/sex_girl.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="name-box">
|
||||
<text style="margin-bottom: 10rpx;">李林</text>
|
||||
<text style="margin-bottom: 10rpx;">{{userInfo.nickName||''}}</text>
|
||||
<view class="fans-box">
|
||||
<image src="@/static/mine/fans.png" mode="aspectFit"></image>
|
||||
<view class="fans-num">1000</view>
|
||||
<view class="fans-num">{{userInfo.tfansNum||'0'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edit-box">
|
||||
@ -40,17 +42,17 @@
|
||||
<view class="points-box">
|
||||
<view class="item-box">
|
||||
<view class="item-text-box">
|
||||
<view>积分<text class="red-text">140</text></view>
|
||||
<view>积分<text class="red-text">{{userInfo.pointsBalance||'0'}}</text></view>
|
||||
<view class="dl-little">赚积分<uni-icons type="right" size="10">{{item.unicode}}</uni-icons></view>
|
||||
</view>
|
||||
<image src="@/static/mine/jifen.png" mode="aspectFit"></image>
|
||||
<image src="@/static/index/zuanshi.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="item-box">
|
||||
<view class="item-text-box">
|
||||
<view>报名<text class="red-text">140</text>次</view>
|
||||
<view>报名<text class="red-text">{{userInfo.report||'0'}}</text>次</view>
|
||||
<view class="dl-little">去提额<uni-icons type="right" size="10">{{item.unicode}}</uni-icons></view>
|
||||
</view>
|
||||
<image src="@/static/mine/baoming.png" mode="aspectFit"></image>
|
||||
<image src="@/static/index/zuanshi.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -132,7 +134,12 @@
|
||||
formatNumberWithUnits,
|
||||
calculateTimeDifference
|
||||
} from '@/utils/common.js'
|
||||
|
||||
import {
|
||||
getJSONData
|
||||
} from '@/utils/auth.js'
|
||||
import {
|
||||
bloggerDetail
|
||||
} from '@/api/member/member.js'
|
||||
export default {
|
||||
components: {
|
||||
tabBarVue,
|
||||
@ -141,17 +148,31 @@
|
||||
return {
|
||||
//当前用户类型
|
||||
nowUserType: null,
|
||||
userInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
nowUserType = getUserType()
|
||||
},
|
||||
mounted() {
|
||||
if (null != getJSONData(constant.userInfo)) {
|
||||
this.userInfo = getJSONData(constant.userInfo)
|
||||
this.getBloggerDetail()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
windowHeight() {
|
||||
return uni.getSystemInfoSync().windowHeight - 50
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getBloggerDetail() {
|
||||
bloggerDetail(this.userInfo.userId).then(res => {
|
||||
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
||||
this.userInfo.pointsBalance = res.data.pointsBalance.toString()
|
||||
this.userInfo.report = res.data.report.toString()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 切换用户身份
|
||||
*/
|
||||
|
@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<view class="dingyue-box">
|
||||
<navigation-bar-vue style="width: 100%;" title="报名" background-color="#FFFFFF"
|
||||
title-color="#3D3D3D"></navigation-bar-vue>
|
||||
<view class="select-box-dom">
|
||||
|
||||
<view class="line-box">
|
||||
<view class="dl-title">领域</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in bloggerTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="t.code==dataObj.bloggerTypeCode?'line-item click':'line-item'"
|
||||
:class="dataObj.bloggerTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'bloggerTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
@ -20,7 +18,8 @@
|
||||
<view class="dl-title">平台</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in platformList">
|
||||
<view v-for="(t,i) in item" :class="t.code==dataObj.platformCode?'line-item click':'line-item'"
|
||||
<view v-for="(t,i) in item"
|
||||
:class="dataObj.platformCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'platformCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
@ -33,7 +32,7 @@
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in noticeTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="t.code==dataObj.noticeTypeCode?'line-item click':'line-item'"
|
||||
:class="dataObj.noticeTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'noticeTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
@ -77,7 +76,7 @@
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in rewardTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="t.code==dataObj.rewardTypeCode?'line-item click':'line-item'"
|
||||
:class="dataObj.rewardTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'rewardTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
@ -112,8 +111,8 @@
|
||||
@change="switchChange($event,'newNotice')" />
|
||||
</view>
|
||||
<view class="seting-view"><text>订阅通告主新通告</text>
|
||||
<switch v-if="dataObj.forkNotice" style="float: right;display: flex;" checked
|
||||
color="#FC1F3E" @change="switchChange($event,'forkNotice')" />
|
||||
<switch v-if="dataObj.forkNotice" style="float: right;display: flex;" checked color="#FC1F3E"
|
||||
@change="switchChange($event,'forkNotice')" />
|
||||
<switch v-else style="float: right;display: flex;" color="#FC1F3E"
|
||||
@change="switchChange($event,'forkNotice')" />
|
||||
</view>
|
||||
@ -123,7 +122,6 @@
|
||||
<view class="line-box" style="align-items: center;">
|
||||
<view class="submit-box" @click="saveSet()">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 输入框示例 -->
|
||||
<uni-popup ref="inputDialog" type="dialog" :key="keywordsValue">
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="新增关键词" placeholder="请输入关键词"
|
||||
@ -140,11 +138,7 @@
|
||||
getSubscribeSet,
|
||||
saveSubscribe
|
||||
} from '@/api/business/subscribeSet.js'
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//一行显示几个
|
||||
@ -181,12 +175,12 @@
|
||||
],
|
||||
//订阅设置对象---后端存储
|
||||
dataObj: {
|
||||
bloggerTypeCode: "",
|
||||
platformCode: "",
|
||||
noticeTypeCode: "",
|
||||
bloggerTypeCode: [],
|
||||
platformCode: [],
|
||||
noticeTypeCode: [],
|
||||
//关键词集和
|
||||
keywordsList: [],
|
||||
rewardTypeCode: "",
|
||||
rewardTypeCode: [],
|
||||
//粉丝是否限制
|
||||
fansLimit: false,
|
||||
fansUp: null,
|
||||
@ -301,7 +295,7 @@
|
||||
let thisArray = [{
|
||||
id: '0',
|
||||
title: "不限",
|
||||
code: ""
|
||||
code: "-1"
|
||||
}]
|
||||
thisArray = thisArray.concat(res.data)
|
||||
for (let i = 0; i < thisArray.length; i += this.showNum) {
|
||||
@ -323,7 +317,19 @@
|
||||
* @param {Object} key
|
||||
*/
|
||||
changeChooseValue(item, key) {
|
||||
this.dataObj[key] = item.code
|
||||
if (item.id == 0) {
|
||||
this.dataObj[key] = []
|
||||
this.dataObj[key].push(item.code)
|
||||
} else {
|
||||
let tempList = []
|
||||
this.dataObj[key].forEach(item => {
|
||||
if (item.code != '-1') {
|
||||
tempList.push(item.code)
|
||||
}
|
||||
})
|
||||
this.dataObj[key] = tempList
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* 添加关键词
|
||||
@ -337,7 +343,6 @@
|
||||
|
||||
<style lang="scss">
|
||||
.dingyue-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
border-top: 1rpx solid #F4F4F4;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
@ -350,18 +355,13 @@
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.select-box-dom {
|
||||
width: 100%;
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 90rpx);
|
||||
overflow-y: scroll;
|
||||
|
||||
.line-box {
|
||||
width: 100%;
|
||||
padding: 30rpx 30rpx 20rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: flex-start;
|
||||
justify-content: inherit;
|
||||
|
||||
.submit-box {
|
||||
padding: 15rpx 0;
|
||||
@ -473,5 +473,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user