1
This commit is contained in:
parent
91548ea26f
commit
6e5ffe0310
@ -1,6 +1,7 @@
|
|||||||
import upload from '@/utils/upload'
|
import upload from '@/utils/upload'
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//------------------名片-----------------------
|
||||||
// 查询当前登录用户的名片
|
// 查询当前登录用户的名片
|
||||||
export function getUserBusiCard() {
|
export function getUserBusiCard() {
|
||||||
return request({
|
return request({
|
||||||
@ -8,6 +9,32 @@ export function getUserBusiCard() {
|
|||||||
method: 'get',
|
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() {
|
export function getUserAddress() {
|
||||||
return request({
|
return request({
|
||||||
@ -15,7 +42,13 @@ export function getUserAddress() {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 博主地址选择器
|
||||||
|
export function uniSelectList() {
|
||||||
|
return request({
|
||||||
|
url: '/member/address/uniSelectList',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
//保存地址信息
|
//保存地址信息
|
||||||
export function saveAddress(data) {
|
export function saveAddress(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -24,7 +57,6 @@ export function saveAddress(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置默认收货地址
|
// 设置默认收货地址
|
||||||
export function setDefault(params) {
|
export function setDefault(params) {
|
||||||
return request({
|
return request({
|
||||||
@ -33,7 +65,6 @@ export function setDefault(params) {
|
|||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除地址
|
// 删除地址
|
||||||
export function removeAddress(params) {
|
export function removeAddress(params) {
|
||||||
return request({
|
return request({
|
||||||
@ -42,7 +73,6 @@ export function removeAddress(params) {
|
|||||||
params:params
|
params:params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取地址详细信息
|
// 获取地址详细信息
|
||||||
export function getById(params) {
|
export function getById(params) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -18,3 +18,11 @@ export function getCatgByCode(params) {
|
|||||||
params:params
|
params:params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 根据code查分类值列表
|
||||||
|
export function uniListByParentCode(params) {
|
||||||
|
return request({
|
||||||
|
url: '/base/category/uniListByParentCode',
|
||||||
|
method: 'get',
|
||||||
|
params:params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -12,6 +12,22 @@
|
|||||||
:imgCode="dataObj.platformCode"></uni-data-select>
|
:imgCode="dataObj.platformCode"></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
</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-field">
|
||||||
<view class="item-lable is-required">
|
<view class="item-lable is-required">
|
||||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>粉丝数
|
<image src="@/static/mine/required.png" mode="aspectFit"></image>粉丝数
|
||||||
@ -32,9 +48,11 @@
|
|||||||
<view class="item-lable is-required">
|
<view class="item-lable is-required">
|
||||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>收货地址
|
<image src="@/static/mine/required.png" mode="aspectFit"></image>收货地址
|
||||||
</view>
|
</view>
|
||||||
<view class="item-value">
|
<view class="item-value">
|
||||||
<view class="choose-add" @click="chooseAddr()">请选择收货地址</view>
|
<uni-data-select v-model="dataObj.addrId" :localdata="addressList"
|
||||||
</view>
|
@change="change($event,'addrId')" :clear="false"
|
||||||
|
:imgCode="dataObj.addrId"></uni-data-select>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-field">
|
<view class="item-field">
|
||||||
<view class="item-lable">
|
<view class="item-lable">
|
||||||
@ -62,7 +80,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-field" style="align-items: center;">
|
<view class="item-field" style="align-items: center;">
|
||||||
<view class="submit-box">提交</view>
|
<view class="submit-box" @click="submitForm">提交</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -70,49 +88,162 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from '@/config'
|
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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//所有可选的平台
|
//所有可选的平台
|
||||||
range: [{
|
range: [],
|
||||||
value: 'xiaohongshu',
|
|
||||||
text: "小红书"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'douyin',
|
|
||||||
text: "抖音"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
//图片数组
|
//图片数组
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
//地址集合
|
||||||
|
addressList:[],
|
||||||
//名片数据对象
|
//名片数据对象
|
||||||
dataObj: {
|
dataObj: {
|
||||||
platformCode: "xiaohongshu",
|
platformCode: "xiaohongshu",
|
||||||
|
accountName:null,
|
||||||
|
accountNumber:null,
|
||||||
fansNum: null,
|
fansNum: null,
|
||||||
tel: null
|
tel: null,
|
||||||
|
addrId:null,
|
||||||
|
price:null,
|
||||||
|
content:null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
//改变选中值
|
|
||||||
change(e, type) {},
|
|
||||||
/**
|
|
||||||
* 选择收货地址
|
|
||||||
*/
|
|
||||||
chooseAddr() {
|
|
||||||
|
|
||||||
},
|
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) {
|
afterRead(file) {
|
||||||
|
|
||||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||||
upload({
|
upload({
|
||||||
url: '',
|
url: '',
|
||||||
filePath: file.tempFilePaths[i]
|
filePath: file.tempFilePaths[i]
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
console.log(res,'215')
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
url: config.baseUrl + res.data
|
url: config.baseUrl + res.data
|
||||||
})
|
})
|
||||||
console.log(this.fileList)
|
console.log(this.fileList,'fileList')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -31,21 +31,21 @@
|
|||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
<view class="card-person-info">
|
<view class="card-person-info">
|
||||||
<view class="card-name">
|
<view class="card-name">
|
||||||
<view>{{ item.nickname }}</view>
|
<view>{{ item.accountName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-text">
|
<view class="detail-text">
|
||||||
<view class="fans-dom">
|
<view class="fans-dom">
|
||||||
粉丝:{{ formatNumberWithUnits(item.fansNum) }}
|
粉丝:{{ formatNumberWithUnits(item.fansNum) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="nickname-dom">
|
<!-- <view class="nickname-dom">-->
|
||||||
昵称:{{ item.accountName }}
|
<!-- 昵称:{{ item.accountName }}-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="ifEdit" @click="del(item)" :class="['edit-dom',item.choosed.length>0?'':'no-choose']">删除
|
<view v-if="ifEdit" @click="remove(item.id)" :class="['edit-dom',item.choosed.length>0?'':'no-choose']">删除
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
formatNumberWithUnits
|
formatNumberWithUnits
|
||||||
} from '@/utils/common.js'
|
} from '@/utils/common.js'
|
||||||
import {
|
import {
|
||||||
getUserBusiCard
|
getUserBusiCard,removeBusiCard
|
||||||
} from '@/api/business/member.js'
|
} from '@/api/business/member.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -92,7 +92,7 @@
|
|||||||
return this.busiCardList.filter((item) => item.choosed.length > 0).length
|
return this.busiCardList.filter((item) => item.choosed.length > 0).length
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -105,6 +105,7 @@
|
|||||||
},
|
},
|
||||||
//查询名片列表
|
//查询名片列表
|
||||||
initData() {
|
initData() {
|
||||||
|
this.busiCardList = []
|
||||||
getUserBusiCard().then(res => {
|
getUserBusiCard().then(res => {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
res.data.map((item) => {
|
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
|
* @param {Object} e
|
||||||
@ -145,8 +164,8 @@
|
|||||||
*/
|
*/
|
||||||
del(item) {},
|
del(item) {},
|
||||||
//名片编辑
|
//名片编辑
|
||||||
edit(item) {
|
edit(id) {
|
||||||
this.$tab.navigateTo('/pages/mine/card/card-detail')
|
this.$tab.navigateTo('/pages/mine/card/card-detail?id='+id)
|
||||||
},
|
},
|
||||||
addCard() {
|
addCard() {
|
||||||
this.$tab.navigateTo('/pages/mine/card/card-detail')
|
this.$tab.navigateTo('/pages/mine/card/card-detail')
|
||||||
|
Loading…
Reference in New Issue
Block a user