Merge branch 'master' of http://122.51.230.86:3000/dianliang/dl_uniapp
This commit is contained in:
commit
bcb8a68013
@ -10,6 +10,24 @@ export function getNoticeList(params) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 订阅查询通告列表
|
||||
export function getSubscribeList(params) {
|
||||
return request({
|
||||
url: '/busi/notice/subscribeList',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
// 关注查询通告列表
|
||||
export function getLoveList(params) {
|
||||
return request({
|
||||
url: '/busi/notice/loveList',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查通告详情
|
||||
export function getNoticeDetail(params) {
|
||||
return request({
|
||||
@ -35,4 +53,4 @@ export function closeNotice(params) {
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
}
|
||||
|
10
api/business/signCard.js
Normal file
10
api/business/signCard.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 关注取消关注
|
||||
export function getSignCard(params) {
|
||||
return request({
|
||||
url: '/member/busiCard/getSignCard',
|
||||
method: '',
|
||||
params: params
|
||||
})
|
||||
}
|
@ -21,7 +21,10 @@ module.exports = {
|
||||
}, {
|
||||
title: "会员协议",
|
||||
code: "member_agreement"
|
||||
},
|
||||
}, {
|
||||
title: "新人手册",
|
||||
code: "new_people_text"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
24
pages.json
24
pages.json
@ -125,6 +125,30 @@
|
||||
"navigationBarTitleText": "会员中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "set/suggest",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "set/my-suggest",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "set/black-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "set/my-info",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}],
|
||||
|
@ -1,62 +1,74 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<div class="body">
|
||||
<rich-text style="width: 100%" :nodes="richTextHtml" />
|
||||
</div>
|
||||
</view>
|
||||
<view class="container">
|
||||
<navigation-bar-vue :title="title" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<div class="body">
|
||||
<rich-text style="width: 100%" :nodes="richTextHtml" />
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSiteConfig } from '@/api/system/config'
|
||||
import parser from 'rich-text-parser'
|
||||
export default {
|
||||
filters: {
|
||||
formatRichText(html) { // 控制小程序中图片大小
|
||||
// console.log(html)
|
||||
const nodes = parser.getRichTextJson(html)
|
||||
return nodes.children
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
richTextHtml: '',
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.title
|
||||
})
|
||||
this.getRichTextHtml(options.code)
|
||||
},
|
||||
methods:{
|
||||
async getRichTextHtml(code){
|
||||
let that = this
|
||||
getSiteConfig({code:code}).then(res => {
|
||||
let json = JSON.parse(res.data)
|
||||
that.richTextHtml = json[0].value
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
import {
|
||||
getSiteConfig
|
||||
} from '@/api/system/config'
|
||||
import parser from 'rich-text-parser'
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
filters: {
|
||||
formatRichText(html) { // 控制小程序中图片大小
|
||||
// console.log(html)
|
||||
const nodes = parser.getRichTextJson(html)
|
||||
return nodes.children
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
richTextHtml: '',
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.title = options.title
|
||||
this.getRichTextHtml(options.code)
|
||||
},
|
||||
methods: {
|
||||
async getRichTextHtml(code) {
|
||||
let that = this
|
||||
getSiteConfig({
|
||||
code: code
|
||||
}).then(res => {
|
||||
let json = JSON.parse(res.data)
|
||||
that.richTextHtml = json[0].value
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
height: 100%;
|
||||
padding: 20rpx;
|
||||
background: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.body{
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.container {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
height: 100%;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
background: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.body {
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 95rpx);
|
||||
overflow-y: scroll;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -70,10 +70,6 @@
|
||||
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="onReachBottomCus" refresher-enabled
|
||||
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
|
||||
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
|
||||
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
|
||||
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
|
||||
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
|
||||
<view style="text-align: center" v-if="dataList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
@ -189,7 +185,7 @@
|
||||
pageSize: 10,
|
||||
//排序方式:new-最新;money-高奖励;
|
||||
sortBy: "",
|
||||
//品牌置换--只要有值代表查品牌置换
|
||||
//品牌置换--只要有值代表查品牌置换
|
||||
gift: "",
|
||||
platformCode: "",
|
||||
platformName: "平台",
|
||||
@ -427,6 +423,7 @@
|
||||
} else {
|
||||
this.dataList = this.dataList.concat(res.data.records)
|
||||
}
|
||||
this.total = res.data.total
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.isTriggered = false
|
||||
@ -712,4 +709,4 @@
|
||||
margin: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -32,6 +32,18 @@
|
||||
|
||||
<script>
|
||||
import noticeItem from '@/pages/components/notice-item.vue'
|
||||
import rightsCode from '@/utils/rightsCode'
|
||||
import {
|
||||
getCatgByCode
|
||||
} from '@/api/system/config.js'
|
||||
import {
|
||||
toast,
|
||||
hasRights
|
||||
} from '@/utils/common.js'
|
||||
import {
|
||||
getSubscribeList,
|
||||
getLoveList
|
||||
} from '@/api/business/notice.js'
|
||||
export default {
|
||||
components: {
|
||||
noticeItem
|
||||
@ -40,14 +52,104 @@
|
||||
return {
|
||||
menus: ['订阅', '关注'],
|
||||
menuIndex: 0,
|
||||
dataList: ['', '', '', ''],
|
||||
dataList: [],
|
||||
isTriggered: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
},
|
||||
//是否显示搜索框
|
||||
showSearch: false,
|
||||
//当前焦点
|
||||
chooseCondition: 9,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false,
|
||||
//平台列表
|
||||
platformList: [],
|
||||
//博主分类
|
||||
bloggerTypeList: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData("dl_platform", "platformList")
|
||||
this.initData("dl_blogger_type", "bloggerTypeList")
|
||||
this.selectDataList()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 查看通告详情
|
||||
* @param {Object} item
|
||||
*/
|
||||
goDetail(item) {
|
||||
this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`)
|
||||
},
|
||||
/**
|
||||
* 初始化数据
|
||||
* @param {Object} code
|
||||
* @param {Object} dataObj
|
||||
*/
|
||||
initData(code, dataObj) {
|
||||
let that = this
|
||||
getCatgByCode({
|
||||
code: code
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this[dataObj] = res.data
|
||||
}
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 查询数据
|
||||
*/
|
||||
selectDataList() {
|
||||
if (this.menuIndex == 0) {
|
||||
getSubscribeList(this.queryParams).then(res => {
|
||||
this.isTriggered = false
|
||||
if (res.code == 200) {
|
||||
if (this.queryParams.pageNum == 1) {
|
||||
this.dataList = res.data.records
|
||||
} else {
|
||||
this.dataList = this.dataList.concat(res.data.records)
|
||||
}
|
||||
this.total = res.data.total
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.isTriggered = false
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
} else {
|
||||
getLoveList(this.queryParams).then(res => {
|
||||
this.isTriggered = false
|
||||
if (res.code == 200) {
|
||||
if (this.queryParams.pageNum == 1) {
|
||||
this.dataList = res.data.records
|
||||
} else {
|
||||
this.dataList = this.dataList.concat(res.data.records)
|
||||
}
|
||||
this.total = res.data.total
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.isTriggered = false
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* 菜单点击
|
||||
* @param {Object} index
|
||||
@ -59,8 +161,15 @@
|
||||
} else if ('关注' == item) {
|
||||
//关注
|
||||
}
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
this.menuIndex = index
|
||||
this.selectDataList()
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
@ -72,6 +181,7 @@
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.queryParams.pageNum++
|
||||
this.selectDataList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
@ -80,6 +190,8 @@
|
||||
this.isTriggered = true
|
||||
this.queryParams.pageNum = 1
|
||||
this.total = 0
|
||||
|
||||
this.selectDataList()
|
||||
},
|
||||
/**
|
||||
* 去订阅设置页面
|
||||
@ -175,4 +287,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,75 +0,0 @@
|
||||
<template>
|
||||
<view class="about-container">
|
||||
<view class="header-section text-center">
|
||||
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
|
||||
</image>
|
||||
<uni-title type="h2" title="若依移动端"></uni-title>
|
||||
</view>
|
||||
|
||||
<view class="content-section">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>版本信息</view>
|
||||
<view class="text-right">v{{version}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>官方邮箱</view>
|
||||
<view class="text-right">ruoyi@xx.com</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>服务热线</view>
|
||||
<view class="text-right">400-999-9999</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>公司网站</view>
|
||||
<view class="text-right">
|
||||
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="copyright">
|
||||
<view>Copyright © 2022 ruoyi.vip All Rights Reserved.</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
url: getApp().globalData.config.appInfo.site_url,
|
||||
version: getApp().globalData.config.appInfo.version
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin-top: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.header-section {
|
||||
display: flex;
|
||||
padding: 30rpx 0 0;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view class="my-card-box">
|
||||
<navigation-bar-vue title="地址详情" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<view class="card-detail">
|
||||
<view class="title">地址信息</view>
|
||||
<view class="item-field">
|
||||
@ -24,8 +26,8 @@
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<uni-data-picker placeholder="请选择" popup-title="请选择收件地址" :localdata="dataTree"
|
||||
v-model="dataObj.cityId" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
|
||||
@popupclosed="onpopupclosed">
|
||||
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="请输入详细地址" />
|
||||
</view>
|
||||
@ -46,11 +48,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
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'
|
||||
import {
|
||||
treeCity
|
||||
} from '@/api/business/base.js'
|
||||
import {
|
||||
saveAddress,
|
||||
getById
|
||||
} from '@/api/business/member.js'
|
||||
import {
|
||||
toast
|
||||
} from '@/utils/common.js'
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 单选数据源
|
||||
@ -61,7 +74,7 @@
|
||||
text: '否',
|
||||
value: "0"
|
||||
}],
|
||||
//城市树结构
|
||||
//城市树结构
|
||||
dataTree: [],
|
||||
//名片数据对象
|
||||
dataObj: {
|
||||
@ -74,83 +87,85 @@
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options){
|
||||
this.initData(options.id,options.isCopy);
|
||||
},
|
||||
onLoad(options) {
|
||||
this.initData(options.id, options.isCopy);
|
||||
},
|
||||
|
||||
onShow(options) {
|
||||
this.initAddress();
|
||||
},
|
||||
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"
|
||||
}
|
||||
}
|
||||
},
|
||||
/**初始化界面*/
|
||||
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
|
||||
});
|
||||
})
|
||||
},
|
||||
/**初始化树结构*/
|
||||
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
|
||||
});
|
||||
})
|
||||
},
|
||||
/**提交*/
|
||||
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,135);
|
||||
console.log(e, 135);
|
||||
},
|
||||
onpopupopened(e) {
|
||||
console.log('popupopened');
|
||||
@ -170,8 +185,9 @@
|
||||
|
||||
<style lang="scss">
|
||||
.my-card-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
border-top: 1rpx solid #F4F4F4;
|
||||
padding: 30rpx;
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 30rpx;
|
||||
@ -183,14 +199,16 @@
|
||||
position: relative;
|
||||
|
||||
.card-detail {
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 95rpx);
|
||||
overflow-y: scroll;
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
|
@ -1,631 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="page-body uni-content-info">
|
||||
<view class='cropper-content'>
|
||||
<view v-if="isShowImg" class="uni-corpper" :style="'width:'+cropperInitW+'px;height:'+cropperInitH+'px;background:#000'">
|
||||
<view class="uni-corpper-content" :style="'width:'+cropperW+'px;height:'+cropperH+'px;left:'+cropperL+'px;top:'+cropperT+'px'">
|
||||
<image :src="imageSrc" :style="'width:'+cropperW+'px;height:'+cropperH+'px'"></image>
|
||||
<view class="uni-corpper-crop-box" @touchstart.stop="contentStartMove" @touchmove.stop="contentMoveing" @touchend.stop="contentTouchEnd"
|
||||
:style="'left:'+cutL+'px;top:'+cutT+'px;right:'+cutR+'px;bottom:'+cutB+'px'">
|
||||
<view class="uni-cropper-view-box">
|
||||
<view class="uni-cropper-dashed-h"></view>
|
||||
<view class="uni-cropper-dashed-v"></view>
|
||||
<view class="uni-cropper-line-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-tr" data-drag="topTight"></view>
|
||||
<view class="uni-cropper-point point-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-rb" data-drag="rightBottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove" @touchend.stop="dragEnd"></view>
|
||||
<view class="uni-cropper-point point-bl" data-drag="bottomLeft"></view>
|
||||
<view class="uni-cropper-point point-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-lt" data-drag="leftTop"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='cropper-config'>
|
||||
<button type="primary reverse" @click="getImage" style='margin-top: 30rpx;'> 选择头像 </button>
|
||||
<button type="warn" @click="getImageInfo" style='margin-top: 30rpx;'> 提交 </button>
|
||||
</view>
|
||||
<canvas canvas-id="myCanvas" :style="'position:absolute;border: 1px solid red; width:'+imageW+'px;height:'+imageH+'px;top:-9999px;left:-9999px;'"></canvas>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import store from "@/store"
|
||||
import { uploadAvatar } from "@/api/system/user"
|
||||
|
||||
const baseUrl = config.baseUrl
|
||||
let sysInfo = uni.getSystemInfoSync()
|
||||
let SCREEN_WIDTH = sysInfo.screenWidth
|
||||
let PAGE_X, // 手按下的x位置
|
||||
PAGE_Y, // 手按下y的位置
|
||||
PR = sysInfo.pixelRatio, // dpi
|
||||
T_PAGE_X, // 手移动的时候x的位置
|
||||
T_PAGE_Y, // 手移动的时候Y的位置
|
||||
CUT_L, // 初始化拖拽元素的left值
|
||||
CUT_T, // 初始化拖拽元素的top值
|
||||
CUT_R, // 初始化拖拽元素的
|
||||
CUT_B, // 初始化拖拽元素的
|
||||
CUT_W, // 初始化拖拽元素的宽度
|
||||
CUT_H, // 初始化拖拽元素的高度
|
||||
IMG_RATIO, // 图片比例
|
||||
IMG_REAL_W, // 图片实际的宽度
|
||||
IMG_REAL_H, // 图片实际的高度
|
||||
DRAFG_MOVE_RATIO = 1, //移动时候的比例,
|
||||
INIT_DRAG_POSITION = 100, // 初始化屏幕宽度和裁剪区域的宽度之差,用于设置初始化裁剪的宽度
|
||||
DRAW_IMAGE_W = sysInfo.screenWidth // 设置生成的图片宽度
|
||||
|
||||
export default {
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data() {
|
||||
return {
|
||||
imageSrc: store.getters.avatar,
|
||||
isShowImg: false,
|
||||
// 初始化的宽高
|
||||
cropperInitW: SCREEN_WIDTH,
|
||||
cropperInitH: SCREEN_WIDTH,
|
||||
// 动态的宽高
|
||||
cropperW: SCREEN_WIDTH,
|
||||
cropperH: SCREEN_WIDTH,
|
||||
// 动态的left top值
|
||||
cropperL: 0,
|
||||
cropperT: 0,
|
||||
|
||||
transL: 0,
|
||||
transT: 0,
|
||||
|
||||
// 图片缩放值
|
||||
scaleP: 0,
|
||||
imageW: 0,
|
||||
imageH: 0,
|
||||
|
||||
// 裁剪框 宽高
|
||||
cutL: 0,
|
||||
cutT: 0,
|
||||
cutB: SCREEN_WIDTH,
|
||||
cutR: '100%',
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: DRAFG_MOVE_RATIO
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
this.loadImage()
|
||||
},
|
||||
methods: {
|
||||
setData: function (obj) {
|
||||
let that = this
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
that.$set(that.$data, key, obj[key])
|
||||
})
|
||||
},
|
||||
getImage: function () {
|
||||
var _this = this
|
||||
uni.chooseImage({
|
||||
success: function (res) {
|
||||
_this.setData({
|
||||
imageSrc: res.tempFilePaths[0],
|
||||
})
|
||||
_this.loadImage()
|
||||
},
|
||||
})
|
||||
},
|
||||
loadImage: function () {
|
||||
var _this = this
|
||||
|
||||
uni.getImageInfo({
|
||||
src: _this.imageSrc,
|
||||
success: function success(res) {
|
||||
IMG_RATIO = 1 / 1
|
||||
if (IMG_RATIO >= 1) {
|
||||
IMG_REAL_W = SCREEN_WIDTH
|
||||
IMG_REAL_H = SCREEN_WIDTH / IMG_RATIO
|
||||
} else {
|
||||
IMG_REAL_W = SCREEN_WIDTH * IMG_RATIO
|
||||
IMG_REAL_H = SCREEN_WIDTH
|
||||
}
|
||||
let minRange = IMG_REAL_W > IMG_REAL_H ? IMG_REAL_W : IMG_REAL_H
|
||||
INIT_DRAG_POSITION = minRange > INIT_DRAG_POSITION ? INIT_DRAG_POSITION : minRange
|
||||
// 根据图片的宽高显示不同的效果 保证图片可以正常显示
|
||||
if (IMG_RATIO >= 1) {
|
||||
let cutT = Math.ceil((SCREEN_WIDTH / IMG_RATIO - (SCREEN_WIDTH / IMG_RATIO - INIT_DRAG_POSITION)) / 2)
|
||||
let cutB = cutT
|
||||
let cutL = Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH + INIT_DRAG_POSITION) / 2)
|
||||
let cutR = cutL
|
||||
_this.setData({
|
||||
cropperW: SCREEN_WIDTH,
|
||||
cropperH: SCREEN_WIDTH / IMG_RATIO,
|
||||
// 初始化left right
|
||||
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
|
||||
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH / IMG_RATIO) / 2),
|
||||
cutL: cutL,
|
||||
cutT: cutT,
|
||||
cutR: cutR,
|
||||
cutB: cutB,
|
||||
// 图片缩放值
|
||||
imageW: IMG_REAL_W,
|
||||
imageH: IMG_REAL_H,
|
||||
scaleP: IMG_REAL_W / SCREEN_WIDTH,
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: IMG_RATIO
|
||||
})
|
||||
} else {
|
||||
let cutL = Math.ceil((SCREEN_WIDTH * IMG_RATIO - (SCREEN_WIDTH * IMG_RATIO)) / 2)
|
||||
let cutR = cutL
|
||||
let cutT = Math.ceil((SCREEN_WIDTH - INIT_DRAG_POSITION) / 2)
|
||||
let cutB = cutT
|
||||
_this.setData({
|
||||
cropperW: SCREEN_WIDTH * IMG_RATIO,
|
||||
cropperH: SCREEN_WIDTH,
|
||||
// 初始化left right
|
||||
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH * IMG_RATIO) / 2),
|
||||
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
|
||||
|
||||
cutL: cutL,
|
||||
cutT: cutT,
|
||||
cutR: cutR,
|
||||
cutB: cutB,
|
||||
// 图片缩放值
|
||||
imageW: IMG_REAL_W,
|
||||
imageH: IMG_REAL_H,
|
||||
scaleP: IMG_REAL_W / SCREEN_WIDTH,
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: IMG_RATIO
|
||||
})
|
||||
}
|
||||
_this.setData({
|
||||
isShowImg: true
|
||||
})
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拖动时候触发的touchStart事件
|
||||
contentStartMove(e) {
|
||||
PAGE_X = e.touches[0].pageX
|
||||
PAGE_Y = e.touches[0].pageY
|
||||
},
|
||||
|
||||
// 拖动时候触发的touchMove事件
|
||||
contentMoveing(e) {
|
||||
var _this = this
|
||||
var dragLengthX = (PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
var dragLengthY = (PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
// 左移
|
||||
if (dragLengthX > 0) {
|
||||
if (this.cutL - dragLengthX < 0) dragLengthX = this.cutL
|
||||
} else {
|
||||
if (this.cutR + dragLengthX < 0) dragLengthX = -this.cutR
|
||||
}
|
||||
|
||||
if (dragLengthY > 0) {
|
||||
if (this.cutT - dragLengthY < 0) dragLengthY = this.cutT
|
||||
} else {
|
||||
if (this.cutB + dragLengthY < 0) dragLengthY = -this.cutB
|
||||
}
|
||||
this.setData({
|
||||
cutL: this.cutL - dragLengthX,
|
||||
cutT: this.cutT - dragLengthY,
|
||||
cutR: this.cutR + dragLengthX,
|
||||
cutB: this.cutB + dragLengthY
|
||||
})
|
||||
|
||||
PAGE_X = e.touches[0].pageX
|
||||
PAGE_Y = e.touches[0].pageY
|
||||
},
|
||||
|
||||
contentTouchEnd() {
|
||||
|
||||
},
|
||||
|
||||
// 获取图片
|
||||
getImageInfo() {
|
||||
var _this = this
|
||||
uni.showLoading({
|
||||
title: '图片生成中...',
|
||||
})
|
||||
// 将图片写入画布
|
||||
const ctx = uni.createCanvasContext('myCanvas')
|
||||
ctx.drawImage(_this.imageSrc, 0, 0, IMG_REAL_W, IMG_REAL_H)
|
||||
ctx.draw(true, () => {
|
||||
// 获取画布要裁剪的位置和宽度 均为百分比 * 画布中图片的宽度 保证了在微信小程序中裁剪的图片模糊 位置不对的问题 canvasT = (_this.cutT / _this.cropperH) * (_this.imageH / pixelRatio)
|
||||
var canvasW = ((_this.cropperW - _this.cutL - _this.cutR) / _this.cropperW) * IMG_REAL_W
|
||||
var canvasH = ((_this.cropperH - _this.cutT - _this.cutB) / _this.cropperH) * IMG_REAL_H
|
||||
var canvasL = (_this.cutL / _this.cropperW) * IMG_REAL_W
|
||||
var canvasT = (_this.cutT / _this.cropperH) * IMG_REAL_H
|
||||
uni.canvasToTempFilePath({
|
||||
x: canvasL,
|
||||
y: canvasT,
|
||||
width: canvasW,
|
||||
height: canvasH,
|
||||
destWidth: canvasW,
|
||||
destHeight: canvasH,
|
||||
quality: 0.5,
|
||||
canvasId: 'myCanvas',
|
||||
success: function (res) {
|
||||
uni.hideLoading()
|
||||
let data = {name: 'avatarfile', filePath: res.tempFilePath}
|
||||
uploadAvatar(data).then(response => {
|
||||
store.commit('SET_AVATAR', baseUrl + response.imgUrl)
|
||||
uni.showToast({ title: "修改成功", icon: 'success' })
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置大小的时候触发的touchStart事件
|
||||
dragStart(e) {
|
||||
T_PAGE_X = e.touches[0].pageX
|
||||
T_PAGE_Y = e.touches[0].pageY
|
||||
CUT_L = this.cutL
|
||||
CUT_R = this.cutR
|
||||
CUT_B = this.cutB
|
||||
CUT_T = this.cutT
|
||||
},
|
||||
|
||||
// 设置大小的时候触发的touchMove事件
|
||||
dragMove(e) {
|
||||
var _this = this
|
||||
var dragType = e.target.dataset.drag
|
||||
switch (dragType) {
|
||||
case 'right':
|
||||
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
if (CUT_R + dragLength < 0) dragLength = -CUT_R
|
||||
this.setData({
|
||||
cutR: CUT_R + dragLength
|
||||
})
|
||||
break
|
||||
case 'left':
|
||||
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
if (CUT_L - dragLength < 0) dragLength = CUT_L
|
||||
if ((CUT_L - dragLength) > (this.cropperW - this.cutR)) dragLength = CUT_L - (this.cropperW - this.cutR)
|
||||
this.setData({
|
||||
cutL: CUT_L - dragLength
|
||||
})
|
||||
break
|
||||
case 'top':
|
||||
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
if (CUT_T - dragLength < 0) dragLength = CUT_T
|
||||
if ((CUT_T - dragLength) > (this.cropperH - this.cutB)) dragLength = CUT_T - (this.cropperH - this.cutB)
|
||||
this.setData({
|
||||
cutT: CUT_T - dragLength
|
||||
})
|
||||
break
|
||||
case 'bottom':
|
||||
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
if (CUT_B + dragLength < 0) dragLength = -CUT_B
|
||||
this.setData({
|
||||
cutB: CUT_B + dragLength
|
||||
})
|
||||
break
|
||||
case 'rightBottom':
|
||||
var dragLengthX = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
var dragLengthY = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
|
||||
if (CUT_B + dragLengthY < 0) dragLengthY = -CUT_B
|
||||
if (CUT_R + dragLengthX < 0) dragLengthX = -CUT_R
|
||||
let cutB = CUT_B + dragLengthY
|
||||
let cutR = CUT_R + dragLengthX
|
||||
|
||||
this.setData({
|
||||
cutB: cutB,
|
||||
cutR: cutR
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* pages/uni-cropper/index.wxss */
|
||||
|
||||
.uni-content-info {
|
||||
/* position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
align-items: center;
|
||||
flex-direction: column; */
|
||||
}
|
||||
|
||||
.cropper-config {
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
|
||||
.cropper-content {
|
||||
min-height: 750rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-corpper {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.uni-corpper-content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uni-corpper-content image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-width: 0 !important;
|
||||
max-width: none !important;
|
||||
height: 100%;
|
||||
min-height: 0 !important;
|
||||
max-height: none !important;
|
||||
image-orientation: 0deg !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
/* 移动图片效果 */
|
||||
|
||||
.uni-cropper-drag-box {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
cursor: move;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1;
|
||||
}
|
||||
/* 内部的信息 */
|
||||
|
||||
.uni-corpper-crop-box {
|
||||
position: absolute;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.uni-corpper-crop-box .uni-cropper-view-box {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
outline: 1rpx solid #69f;
|
||||
outline-color: rgba(102, 153, 255, .75)
|
||||
}
|
||||
/* 横向虚线 */
|
||||
|
||||
.uni-cropper-dashed-h {
|
||||
position: absolute;
|
||||
top: 33.33333333%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 33.33333333%;
|
||||
border-top: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
border-bottom: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
/* 纵向虚线 */
|
||||
|
||||
.uni-cropper-dashed-v {
|
||||
position: absolute;
|
||||
left: 33.33333333%;
|
||||
top: 0;
|
||||
width: 33.33333333%;
|
||||
height: 100%;
|
||||
border-left: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
border-right: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
/* 四个方向的线 为了之后的拖动事件*/
|
||||
|
||||
.uni-cropper-line-t {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1rpx;
|
||||
opacity: 0.1;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-t::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0rpx;
|
||||
width: 100%;
|
||||
-webkit-transform: translate3d(0, -50%, 0);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
bottom: 0;
|
||||
height: 41rpx;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-r {
|
||||
position: absolute;
|
||||
display: block;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
right: 0rpx;
|
||||
width: 1rpx;
|
||||
opacity: 0.1;
|
||||
height: 100%;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-r::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 41rpx;
|
||||
-webkit-transform: translate3d(-50%, 0, 0);
|
||||
transform: translate3d(-50%, 0, 0);
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-b {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-color: #69f;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 1rpx;
|
||||
opacity: 0.1;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-b::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0rpx;
|
||||
width: 100%;
|
||||
-webkit-transform: translate3d(0, -50%, 0);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
bottom: 0;
|
||||
height: 41rpx;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-l {
|
||||
position: absolute;
|
||||
display: block;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 1rpx;
|
||||
opacity: 0.1;
|
||||
height: 100%;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-l::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 41rpx;
|
||||
-webkit-transform: translate3d(-50%, 0, 0);
|
||||
transform: translate3d(-50%, 0, 0);
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-point {
|
||||
width: 5rpx;
|
||||
height: 5rpx;
|
||||
background-color: #69f;
|
||||
opacity: .75;
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.point-t {
|
||||
top: -3rpx;
|
||||
left: 50%;
|
||||
margin-left: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-tr {
|
||||
top: -3rpx;
|
||||
left: 100%;
|
||||
margin-left: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-r {
|
||||
top: 50%;
|
||||
left: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-rb {
|
||||
left: 100%;
|
||||
top: 100%;
|
||||
-webkit-transform: translate3d(-50%, -50%, 0);
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
cursor: n-resize;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background-color: #69f;
|
||||
position: absolute;
|
||||
z-index: 1112;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.point-b {
|
||||
left: 50%;
|
||||
top: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-bl {
|
||||
left: 0%;
|
||||
top: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-l {
|
||||
left: 0%;
|
||||
top: 50%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-lt {
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
/* 裁剪框预览内容 */
|
||||
|
||||
.uni-cropper-viewer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.uni-cropper-viewer image {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view class="my-card-box">
|
||||
<navigation-bar-vue title="名片详情" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<view class="card-detail">
|
||||
<view class="title">名片信息</view>
|
||||
<view class="item-field">
|
||||
@ -12,22 +14,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>平台账号
|
||||
</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>粉丝数
|
||||
@ -48,11 +50,10 @@
|
||||
<view class="item-lable is-required">
|
||||
<image src="@/static/mine/required.png" mode="aspectFit"></image>收货地址
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<uni-data-select v-model="dataObj.addrId" :localdata="addressList"
|
||||
@change="change($event,'addrId')" :clear="false"
|
||||
:imgCode="dataObj.addrId"></uni-data-select>
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<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">
|
||||
<view class="item-lable">
|
||||
@ -87,12 +88,24 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
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'
|
||||
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 {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//所有可选的平台
|
||||
@ -100,137 +113,141 @@
|
||||
sizeType: ['compressed'],
|
||||
//图片数组
|
||||
fileList: [],
|
||||
//地址集合
|
||||
addressList:[],
|
||||
//地址集合
|
||||
addressList: [],
|
||||
//名片数据对象
|
||||
dataObj: {
|
||||
platformCode: "xiaohongshu",
|
||||
accountName:null,
|
||||
accountNumber:null,
|
||||
accountName: null,
|
||||
accountNumber: null,
|
||||
fansNum: null,
|
||||
tel: null,
|
||||
addrId:null,
|
||||
price:null,
|
||||
content:null,
|
||||
addrId: null,
|
||||
price: null,
|
||||
content: null,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options){
|
||||
this.initData(options.id)
|
||||
},
|
||||
onShow(){
|
||||
this.initAddress()
|
||||
this.initPlatForm()
|
||||
},
|
||||
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,
|
||||
}
|
||||
}
|
||||
},
|
||||
/**初始化数据*/
|
||||
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
|
||||
});
|
||||
})
|
||||
},
|
||||
/**初始化分类*/
|
||||
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
|
||||
});
|
||||
})
|
||||
},
|
||||
/**查询当前登录用户的地址*/
|
||||
initAddress() {
|
||||
uniSelectList().then(res => {
|
||||
this.addressList = res.data
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
//改变选中值
|
||||
change(e, type) {},
|
||||
//改变选中值
|
||||
change(e, type) {},
|
||||
|
||||
/**选择收货地址*/
|
||||
chooseAddr() {
|
||||
/**选择收货地址*/
|
||||
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
|
||||
});
|
||||
})
|
||||
},
|
||||
/**提交*/
|
||||
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) {
|
||||
|
||||
@ -239,11 +256,11 @@
|
||||
url: '',
|
||||
filePath: file.tempFilePaths[i]
|
||||
}).then((res) => {
|
||||
console.log(res,'215')
|
||||
console.log(res, '215')
|
||||
this.fileList.push({
|
||||
url: config.baseUrl + res.data
|
||||
})
|
||||
console.log(this.fileList,'fileList')
|
||||
console.log(this.fileList, 'fileList')
|
||||
})
|
||||
}
|
||||
},
|
||||
@ -257,8 +274,11 @@
|
||||
|
||||
<style lang="scss">
|
||||
.my-card-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
border-top: 1rpx solid #F4F4F4;
|
||||
padding: 30rpx;
|
||||
background-color: white;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 30rpx;
|
||||
@ -266,10 +286,12 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
justify-content: start;
|
||||
position: relative;
|
||||
|
||||
.card-detail {
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 95rpx);
|
||||
overflow-y: scroll;
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
background-color: white;
|
||||
@ -277,7 +299,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
justify-content: start;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
|
@ -13,6 +13,9 @@
|
||||
size="16"></uni-icons><text>退出管理</text></view>
|
||||
</view>
|
||||
<view class="addr-list-box">
|
||||
<view style="text-align: center" v-if="busiCardList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
<view class="card-dom " v-for="item in busiCardList">
|
||||
<!-- 多选框--管理状态或者选择名片时使用 -->
|
||||
<view class="choose-dom" v-if="ifChoose">
|
||||
@ -315,7 +318,6 @@
|
||||
|
||||
.my-card-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
|
@ -1,112 +0,0 @@
|
||||
<template>
|
||||
<view class="help-container">
|
||||
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
|
||||
<view class="text-title">
|
||||
<view :class="item.icon"></view>{{ item.title }}
|
||||
</view>
|
||||
<view class="childList">
|
||||
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
|
||||
@click="handleText(child)">
|
||||
<view class="text-item">{{ child.title }}</view>
|
||||
<view class="line" v-if="zindex !== item.childList.length - 1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
icon: 'iconfont icon-github',
|
||||
title: '若依问题',
|
||||
childList: [{
|
||||
title: '若依开源吗?',
|
||||
content: '开源'
|
||||
}, {
|
||||
title: '若依可以商用吗?',
|
||||
content: '可以'
|
||||
}, {
|
||||
title: '若依官网地址多少?',
|
||||
content: 'http://ruoyi.vip'
|
||||
}, {
|
||||
title: '若依文档地址多少?',
|
||||
content: 'http://doc.ruoyi.vip'
|
||||
}]
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-help',
|
||||
title: '其他问题',
|
||||
childList: [{
|
||||
title: '如何退出登录?',
|
||||
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录',
|
||||
}, {
|
||||
title: '如何修改用户头像?',
|
||||
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像',
|
||||
}, {
|
||||
title: '如何修改登录密码?',
|
||||
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码',
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleText(item) {
|
||||
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.help-container {
|
||||
margin-bottom: 100rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.list-title {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.childList {
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
|
||||
border-radius: 16rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.text-title {
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 16px;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text-item {
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.question {
|
||||
color: #606266;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
@ -1,127 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="example">
|
||||
<uni-forms ref="form" :model="user" labelWidth="80px">
|
||||
<uni-forms-item label="用户昵称" name="nickName">
|
||||
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="手机号码" name="phonenumber">
|
||||
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="邮箱" name="email">
|
||||
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="性别" name="sex" required>
|
||||
<uni-data-checkbox v-model="user.sex" :localdata="sexs" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<button type="primary" @click="submit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
import { updateUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
nickName: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
sex: ""
|
||||
},
|
||||
sexs: [{
|
||||
text: '男',
|
||||
value: "0"
|
||||
}, {
|
||||
text: '女',
|
||||
value: "1"
|
||||
}],
|
||||
rules: {
|
||||
nickName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '用户昵称不能为空'
|
||||
}]
|
||||
},
|
||||
phonenumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '手机号码不能为空'
|
||||
}, {
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
errorMessage: '请输入正确的手机号码'
|
||||
}]
|
||||
},
|
||||
email: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '邮箱地址不能为空'
|
||||
}, {
|
||||
format: 'email',
|
||||
errorMessage: '请输入正确的邮箱地址'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
})
|
||||
},
|
||||
submit(ref) {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.example {
|
||||
padding: 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.segmented-control {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
@ -1,44 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<uni-list>
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
|
||||
</uni-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roleGroup: "",
|
||||
postGroup: ""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
this.roleGroup = response.roleGroup
|
||||
this.postGroup = response.postGroup
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
@ -31,7 +31,7 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="edit-box">
|
||||
<view class="edit-box" @click="goEdit()">
|
||||
<text style="margin-right: 10rpx;">编辑</text>
|
||||
<uni-icons v-if="ifHasCard" type="right" color="#623109" size="12"></uni-icons>
|
||||
<uni-icons v-else type="right" color="#929292" size="12"></uni-icons>
|
||||
@ -129,27 +129,27 @@
|
||||
<view class="box-room">
|
||||
<view class="detail-title">其他信息</view>
|
||||
<view class="menu-box">
|
||||
<view class="menu-item">
|
||||
<view class="menu-item" @click="viewNewPeople()">
|
||||
<!-- <image src="@/static/mine/xinrenshouce.png" mode="aspectFit"></image> -->
|
||||
<image src="@/static/mine/caise/shouce.png" mode="aspectFit"></image>
|
||||
<view>新人手册</view>
|
||||
</view>
|
||||
<view class="menu-item">
|
||||
<view class="menu-item" @click="toggle('center')">
|
||||
<!-- <image src="@/static/mine/kefu.png" mode="aspectFit"></image> -->
|
||||
<image src="@/static/mine/caise/kefu.png" mode="aspectFit"></image>
|
||||
<view>联系客服</view>
|
||||
</view>
|
||||
<view class="menu-item">
|
||||
<view class="menu-item" @click="toggle('center')">
|
||||
<!-- <image src="@/static/mine/gognzhonghao.png" mode="aspectFit"></image> -->
|
||||
<image src="@/static/mine/caise/weixin.png" mode="aspectFit"></image>
|
||||
<view>公众号</view>
|
||||
</view>
|
||||
<view class="menu-item">
|
||||
<view class="menu-item" @click="toggle('center')">
|
||||
<!-- <image src="@/static/mine/jairushequ.png" mode="aspectFit"></image> -->
|
||||
<image src="@/static/mine/caise/shequ.png" mode="aspectFit"></image>
|
||||
<view>加入社区</view>
|
||||
</view>
|
||||
<view class="menu-item">
|
||||
<view class="menu-item" @click="goSuggest()">
|
||||
<!-- <image src="@/static/mine/yijianfankui.png" mode="aspectFit"></image> -->
|
||||
<image src="@/static/mine/caise/yijian.png" mode="aspectFit"></image>
|
||||
<view>意见反馈</view>
|
||||
@ -157,6 +157,12 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<image src="@/static/mine/erweima.jpg" mode="aspectFit"></image>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -194,6 +200,7 @@
|
||||
data() {
|
||||
return {
|
||||
localUserType: this.nowUserType,
|
||||
globalConfig: getApp().globalData.config,
|
||||
//是否已开通会员
|
||||
ifHasCard: false,
|
||||
userInfo: {}
|
||||
@ -218,6 +225,11 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggle(type) {
|
||||
this.type = type
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(type)
|
||||
},
|
||||
getBloggerDetail() {
|
||||
bloggerDetail(this.userInfo.userId).then(res => {
|
||||
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
||||
@ -243,6 +255,12 @@
|
||||
goMyCard() {
|
||||
this.$tab.navigateTo('/pages/mine/card/my-card')
|
||||
},
|
||||
/**
|
||||
* 跳转建议列表
|
||||
*/
|
||||
goSuggest() {
|
||||
this.$tab.navigateTo('/pages/mine/set/suggest')
|
||||
},
|
||||
/**
|
||||
* 跳转地址列表
|
||||
*/
|
||||
@ -251,12 +269,35 @@
|
||||
},
|
||||
goMemberCard() {
|
||||
this.$tab.navigateTo('/pages/mine/member/member-card')
|
||||
},
|
||||
/**
|
||||
* 跳转编辑页
|
||||
*/
|
||||
goEdit() {
|
||||
this.$tab.navigateTo('/pages/mine/set/my-info')
|
||||
},
|
||||
viewNewPeople() {
|
||||
this.$tab.navigateTo(
|
||||
`/pages/common/richview/index?title=${this.globalConfig.appInfo.agreements[3].title}&code=${this.globalConfig.appInfo.agreements[3].code}`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.uni-popup {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
.vue-ref {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.mine-container {
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
|
@ -1,85 +0,0 @@
|
||||
<template>
|
||||
<view class="pwd-retrieve-container">
|
||||
<uni-forms ref="form" :value="user" labelWidth="80px">
|
||||
<uni-forms-item name="oldPassword" label="旧密码">
|
||||
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="newPassword" label="新密码">
|
||||
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="confirmPassword" label="确认密码">
|
||||
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
||||
</uni-forms-item>
|
||||
<button type="primary" @click="submit">提交</button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserPwd } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
oldPassword: undefined,
|
||||
newPassword: undefined,
|
||||
confirmPassword: undefined
|
||||
},
|
||||
rules: {
|
||||
oldPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '旧密码不能为空'
|
||||
}]
|
||||
},
|
||||
newPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '新密码不能为空',
|
||||
},
|
||||
{
|
||||
minLength: 6,
|
||||
maxLength: 20,
|
||||
errorMessage: '长度在 6 到 20 个字符'
|
||||
}
|
||||
]
|
||||
},
|
||||
confirmPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '确认密码不能为空'
|
||||
}, {
|
||||
validateFunction: (rule, value, data) => data.newPassword === value,
|
||||
errorMessage: '两次输入的密码不一致'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.pwd-retrieve-container {
|
||||
padding-top: 36rpx;
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
225
pages/mine/set/black-list.vue
Normal file
225
pages/mine/set/black-list.vue
Normal file
@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<view class="my-card-box">
|
||||
<navigation-bar-vue title="我的黑名单" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<view class="addr-list-box">
|
||||
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="onReachBottomCus" refresher-enabled
|
||||
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view class="user-image-box" v-for="(item,index) in dataList">
|
||||
<view class="dl-image-box">
|
||||
<image v-if="!item.avatar" class="touxiang" src="@/static/images/profile.jpg" mode="aspectFit">
|
||||
</image>
|
||||
<image v-else class="touxiang" :src="item.avatar" mode="aspectFit"></image>
|
||||
<image class="sex" src="@/static/mine/sex_girl.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="name-box">
|
||||
<view class="title-box">
|
||||
{{item.nickName || ''}}
|
||||
</view>
|
||||
<view class="bottom-box">
|
||||
<view class="fans-box">
|
||||
<view class="fans-num">{{item.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edit-box" @click="remove(item.id)">
|
||||
<view class="move-button">移除</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 navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataList: [{
|
||||
nickName: "李林",
|
||||
createTime: "2024-02-10 12:22:44",
|
||||
}, {
|
||||
nickName: "李林",
|
||||
createTime: "2024-02-10 12:22:44",
|
||||
}],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
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
|
||||
},
|
||||
remove(id) {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.my-card-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 32rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.addr-list-box {
|
||||
background-color: #F6F6F6;
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 91rpx);
|
||||
overflow-y: scroll;
|
||||
padding: 0 30rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
|
||||
.user-image-box {
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.dl-image-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100rpx;
|
||||
position: relative;
|
||||
|
||||
.touxiang {
|
||||
border-radius: 50%;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.sex {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
right: 0rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.name-box {
|
||||
display: flex;
|
||||
padding-left: 20rpx;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
|
||||
.title-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
margin-left: 10rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.fans-box {
|
||||
max-width: 200rpx;
|
||||
margin-right: 10rpx;
|
||||
font-size: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5rpx 10rpx;
|
||||
color: #929292;
|
||||
|
||||
image {
|
||||
height: 20rpx;
|
||||
width: 20rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.member-box {
|
||||
flex: 1;
|
||||
font-size: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #FC1F3E;
|
||||
color: white;
|
||||
padding: 5rpx 10rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.fans-num {}
|
||||
}
|
||||
|
||||
.edit-box {
|
||||
color: #929292;
|
||||
text-align: right;
|
||||
padding-right: 20rpx;
|
||||
font-size: 22rpx;
|
||||
width: 130rpx;
|
||||
|
||||
.move-button {
|
||||
color: #FC405B;
|
||||
text-align: center;
|
||||
padding: 8rpx 20rpx;
|
||||
background-color: white;
|
||||
border-radius: 25rpx;
|
||||
border: 1rpx solid #FC405B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
192
pages/mine/set/my-info.vue
Normal file
192
pages/mine/set/my-info.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<view class="my-info-box">
|
||||
<navigation-bar-vue title="个人信息" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<view class="form-data-box">
|
||||
<!-- 基础表单校验 -->
|
||||
<uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
|
||||
<uni-forms-item labelWidth="280rpx" label="头像" required name="avatar">
|
||||
<uni-file-picker small="true" :value="fileList" :sizeType="sizeType" @select="afterRead"
|
||||
@delete="deleteFile" limit="1"></uni-file-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="昵称" required name="nickName">
|
||||
<uni-easyinput v-model="valiFormData.nickName" placeholder="请输入" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="联系方式" required name="phonenumber">
|
||||
<uni-easyinput v-model="valiFormData.phonenumber" placeholder="请输入" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="绑定手机号" required name="userName">
|
||||
<uni-easyinput disabled v-model="valiFormData.userName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="收款码" required name="tRecipientImage">
|
||||
<uni-file-picker small="true" :value="recipientImageList" :sizeType="sizeType"
|
||||
@select="afterReadRecipient" @delete="deleteFileRecipient" limit="1"></uni-file-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="收款码真实姓名" required name="tRecipientName">
|
||||
<uni-easyinput v-model="valiFormData.tRecipientName" placeholder="请输入" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item labelWidth="280rpx" label="通告报名免打扰" required name="tOpenDisturb">
|
||||
<uni-data-checkbox v-model="valiFormData.tOpenDisturb" :localdata="ranges" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<button type="primary" style="background-color: #FC2B49;" @click="submit('valiForm')">提交</button>
|
||||
<view class="my-black-list" @click="goMyBlackList()">我的黑名单<uni-icons type="right" color="#623109"
|
||||
size="12"></uni-icons></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sizeType: ['compressed'],
|
||||
//头像数组
|
||||
fileList: [],
|
||||
//收款码数组
|
||||
recipientImageList: [],
|
||||
ranges: [{
|
||||
text: '开启',
|
||||
value: "1"
|
||||
}, {
|
||||
text: '关闭',
|
||||
value: "0"
|
||||
}],
|
||||
// 校验表单数据
|
||||
valiFormData: {
|
||||
avatar: "",
|
||||
nickName: "",
|
||||
phonenumber: "",
|
||||
userName: "",
|
||||
tRecipientImage: "",
|
||||
tRecipientName: "",
|
||||
tOpenDisturb: "0"
|
||||
},
|
||||
// 校验规则
|
||||
rules: {
|
||||
avatar: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '头像不能为空'
|
||||
}]
|
||||
},
|
||||
nickName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '昵称不能为空'
|
||||
}]
|
||||
},
|
||||
phonenumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '联系方式不能为空'
|
||||
}]
|
||||
},
|
||||
tRecipientImage: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '收款码不能为空'
|
||||
}]
|
||||
},
|
||||
tRecipientName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '收款码真实姓名不能为空'
|
||||
}]
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goMyBlackList() {
|
||||
this.$tab.navigateTo('/pages/mine/set/black-list')
|
||||
},
|
||||
submit(ref) {
|
||||
this.$refs[ref].validate().then(res => {
|
||||
console.log('success', res);
|
||||
uni.showToast({
|
||||
title: `校验通过`
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
})
|
||||
},
|
||||
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, 'fileList')
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteFile(file, index) {
|
||||
console.log('删除文件');
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
afterReadRecipient(file) {
|
||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||
upload({
|
||||
url: '',
|
||||
filePath: file.tempFilePaths[i]
|
||||
}).then((res) => {
|
||||
console.log(res, '215')
|
||||
this.recipientImageList.push({
|
||||
url: config.baseUrl + res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteFileRecipient(file, index) {
|
||||
console.log('删除文件');
|
||||
this.recipientImageList.splice(index, 1);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.my-info-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
border-top: 1rpx solid #F4F4F4;
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 30rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.form-data-box {
|
||||
border-top: 1rpx solid #F4F4F4;
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 95rpx);
|
||||
overflow-y: scroll;
|
||||
width: 100%;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: white;
|
||||
|
||||
.my-black-list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
148
pages/mine/set/my-suggest.vue
Normal file
148
pages/mine/set/my-suggest.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<view class="my-card-box">
|
||||
<navigation-bar-vue title="我的反馈" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<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">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="addr-item-opt">
|
||||
<uni-file-picker samll="true" :value="item.imagesList" readonly="true"
|
||||
limit="9"></uni-file-picker>
|
||||
</view>
|
||||
<view class="addr-bottom">
|
||||
{{item.createTime}}
|
||||
</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 navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataList: [{
|
||||
createTime: "2024-02-10 12:22:44",
|
||||
content: "我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见",
|
||||
images: "",
|
||||
imagesList: [
|
||||
'/profile/upload/2025/03/18/f936812fd66e18007385b187cc6b12c_20250318105540A001.png',
|
||||
'/profile/upload/2025/03/18/5_20250318172439A002.png'
|
||||
],
|
||||
backContent: "反馈内容",
|
||||
backImages: [],
|
||||
backTime: "2024-02-10 12:22:44",
|
||||
}],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
.my-card-box {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 32rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.addr-list-box {
|
||||
background-color: #F6F6F6;
|
||||
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 91rpx);
|
||||
overflow-y: scroll;
|
||||
padding: 0 30rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
justify-content: start;
|
||||
|
||||
.addr-item-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
background-color: white;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1rpx solid #F2F2F2;
|
||||
|
||||
.addr-item-top {
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.addr-item-opt {
|
||||
width: 100%;
|
||||
padding-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
}
|
||||
|
||||
.addr-bottom {
|
||||
padding-top: 20rpx;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
177
pages/mine/set/suggest.vue
Normal file
177
pages/mine/set/suggest.vue
Normal file
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view class="suggest-content">
|
||||
<navigation-bar-vue title="意见反馈" style="width: 100%;" background-color="#ffffff"
|
||||
title-color="#000000"></navigation-bar-vue>
|
||||
<view class="card-detail">
|
||||
<view class="item-field">
|
||||
<view class="item-lable is-required">
|
||||
写下你的建议
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<textarea v-model="dataObj.content" placeholder="请输入" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field">
|
||||
<view class="item-lable is-required">
|
||||
上传材料
|
||||
</view>
|
||||
<view class="item-value">
|
||||
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile"
|
||||
limit="9"></uni-file-picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-field" style="align-items: center;">
|
||||
<view class="submit-box" @click="submitForm">提交</view>
|
||||
</view>
|
||||
<view class="item-field" style="align-items: center;">
|
||||
<view class="my-suggest-dom" @click="goMySuggest()">
|
||||
<text>我的反馈</text>
|
||||
<uni-icons type="right" color="#623109" size="12"></uni-icons>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||
export default {
|
||||
components: {
|
||||
navigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataObj: {
|
||||
content: ""
|
||||
},
|
||||
sizeType: ['compressed'],
|
||||
//图片数组
|
||||
fileList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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, 'fileList')
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteFile(file, index) {
|
||||
console.log('删除文件');
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
/**提交*/
|
||||
submitForm() {},
|
||||
/**
|
||||
* 去我的建议列表
|
||||
*/
|
||||
goMySuggest() {
|
||||
this.$tab.navigateTo('/pages/mine/set/my-suggest')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.suggest-content {
|
||||
padding-top: calc(90rpx + var(--status-bar-height));
|
||||
background-color: white;
|
||||
width: 100%;
|
||||
color: #363636;
|
||||
font-size: 32rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.card-detail {
|
||||
border-top: 1rpx solid #F2F2F2;
|
||||
width: 100%;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.item-field {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: self-start;
|
||||
justify-content: center;
|
||||
|
||||
.item-lable {
|
||||
padding: 15rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
.item-value {
|
||||
width: 100%;
|
||||
|
||||
input {
|
||||
padding-left: 20rpx;
|
||||
line-height: 1;
|
||||
height: 70rpx;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.choose-add {
|
||||
color: #686868;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
color: #686868;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.submit-box {
|
||||
padding: 15rpx 0;
|
||||
background-color: #FC1F3E;
|
||||
color: white;
|
||||
width: 70%;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.my-suggest-dom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,78 +0,0 @@
|
||||
<template>
|
||||
<view class="setting-container" :style="{height: `${windowHeight}px`}">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow" @click="handleToPwd">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-password menu-icon"></view>
|
||||
<view>修改密码</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-refresh menu-icon"></view>
|
||||
<view>检查更新</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleCleanTmp">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-clean menu-icon"></view>
|
||||
<view>清理缓存</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item item-box">
|
||||
<view class="content text-center" @click="handleLogout">
|
||||
<text class="text-black">退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
windowHeight: uni.getSystemInfoSync().windowHeight
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleToPwd() {
|
||||
this.$tab.navigateTo('/pages/mine/pwd/index')
|
||||
},
|
||||
handleToUpgrade() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleCleanTmp() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleLogout() {
|
||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
background-color: #FFFFFF;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
@ -8,8 +8,8 @@
|
||||
<image class="image" :src="userDetail.avatar?imageUrl+userDetail.avatar :'/static/images/profile.jpg'"
|
||||
mode="aspectFit"></image>
|
||||
<view class="name-info">
|
||||
<view class="name">{{userDetail.nickName}}</view>
|
||||
<view class="text">{{userDetail.identityType}}</view>
|
||||
<view class="name">{{userDetail.nickName||''}}</view>
|
||||
<view class="text">{{userDetail.identityType||''}}</view>
|
||||
</view>
|
||||
<view class="fork-info">
|
||||
<view class="up-box">
|
||||
@ -25,9 +25,9 @@
|
||||
<view class="dl-notice-title">
|
||||
<image class="dl-image" :src="'/static/platform/'+noticeDetail.platformCode+'.png'"
|
||||
mode="aspectFit"></image>
|
||||
<view class="dl-text">{{noticeDetail.title}}</view>
|
||||
<view class="dl-text">{{noticeDetail.title||''}}</view>
|
||||
</view>
|
||||
<view class="end-time">截止日期:{{noticeDetail.endDate}}</view>
|
||||
<view class="end-time">截止日期:{{noticeDetail.endDate||''}}</view>
|
||||
<view class="field-box">
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
@ -35,45 +35,45 @@
|
||||
</view>
|
||||
<view class="dl-value">
|
||||
<text v-if="null==noticeDetail.feeUp">无稿费</text>
|
||||
<text v-else>¥{{noticeDetail.feeDown}}-{{noticeDetail.feeUp}}</text>
|
||||
<text v-else>¥{{noticeDetail.feeDown||''}}-{{noticeDetail.feeUp||''}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
招募名额:
|
||||
</view>
|
||||
<view class="dl-value">{{noticeDetail.needNum}}人 </view>
|
||||
<view class="dl-value">{{noticeDetail.needNum||''}}人 </view>
|
||||
</view>
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
产品品牌:
|
||||
</view>
|
||||
<view class="dl-value">{{noticeDetail.brand}} </view>
|
||||
<view class="dl-value">{{noticeDetail.brand||''}} </view>
|
||||
</view>
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
粉丝要求:
|
||||
</view>
|
||||
<view class="dl-value">
|
||||
{{formatNumberWithUnits(noticeDetail.fansDown)}}-{{formatNumberWithUnits(noticeDetail.fansUp)}}
|
||||
{{formatNumberWithUnits(noticeDetail.fansDown)||''}}-{{formatNumberWithUnits(noticeDetail.fansUp)||''}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
地区要求:
|
||||
</view>
|
||||
<view class="dl-value">{{noticeDetail.city}} </view>
|
||||
<view class="dl-value">{{noticeDetail.city||''}} </view>
|
||||
</view>
|
||||
<view class="dl-item">
|
||||
<view class="dl-label">
|
||||
博主类型:
|
||||
</view>
|
||||
<view class="dl-value">{{noticeDetail.bloggerTypes}}</view>
|
||||
<view class="dl-value">{{noticeDetail.bloggerTypes||''}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-box">
|
||||
<text class="update-text">{{calculateTimeDifference(noticeDetail.updateTime)}}更新</text>
|
||||
<text class="view-text">{{noticeDetail.viewNum}} 阅读</text>
|
||||
<text class="update-text">{{calculateTimeDifference(noticeDetail.updateTime)||''}}更新</text>
|
||||
<text class="view-text">{{noticeDetail.viewNum||''}} 阅读</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 通告详情 -->
|
||||
@ -83,7 +83,8 @@
|
||||
<rich-text style="width: 100%" :nodes="noticeDetail.detail" />
|
||||
</view>
|
||||
<view class="detail-images">
|
||||
<image v-for="(item,index) in noticeDetail.imageArray" :src="imageUrl+item" mode="widthFix"></image>
|
||||
<image v-for="(item,index) in noticeDetail.imageArray" @click="preview(noticeDetail.imageArray)"
|
||||
:src="imageUrl+item" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系方式 -->
|
||||
@ -118,7 +119,7 @@
|
||||
</view>
|
||||
<!-- 报名列表 -->
|
||||
<view class="info-box notice-detail">
|
||||
<view class="detail-title">收到报名:{{imageArray.length}}人</view>
|
||||
<view class="detail-title">已报名:{{imageArray.length||0}}人</view>
|
||||
<view class="image-box" v-if="imageArray.length>0"
|
||||
:style="{height:(imageArray.length*(imageWidth+10)+20)+'rpx'}">
|
||||
<view class="image-row" v-for="(row,rowIndex) in imageArray">
|
||||
@ -132,7 +133,7 @@
|
||||
<!-- 去报名,始终浮动下方 -->
|
||||
<view class="dl-bottom-box" v-show="showBottom">
|
||||
<!-- 报名 -->
|
||||
<view class="report-box" v-if="null==userInfo || noticeDetail.userId!=userInfo.userId">
|
||||
<view class="report-box">
|
||||
<view @click="goHome()">
|
||||
<image src="@/static/detail/home.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
@ -144,7 +145,7 @@
|
||||
<view v-else class="join-report" @click="changeUserType()">切换博主后报名</view>
|
||||
</view>
|
||||
<!-- 通告发布人能操作的 -->
|
||||
<view class="report-box" v-if="null!=userInfo && userInfo.userId==noticeDetail.userId">
|
||||
<view class="report-box" v-if="null!=userInfo && userInfo.userId==noticeDetail.userId&&ifBz==false">
|
||||
<view v-if="'0'==noticeDetail.approvalStatus" class="close-notice">关闭</view>
|
||||
<view v-if="'0'==noticeDetail.approvalStatus" class="waiting-approval">
|
||||
<view>审核中</view>
|
||||
@ -195,6 +196,9 @@
|
||||
postForkUser
|
||||
} from '@/api/business/base.js'
|
||||
import config from '@/config'
|
||||
import {
|
||||
getSignCard
|
||||
} from '@/api/business/signCard.js'
|
||||
export default {
|
||||
components: {
|
||||
shareImages,
|
||||
@ -277,6 +281,16 @@
|
||||
this.viewNotice()
|
||||
},
|
||||
methods: {
|
||||
preview(imageArray) {
|
||||
let previewImages = []
|
||||
imageArray.forEach(it => {
|
||||
previewImages.push(this.imageUrl + it)
|
||||
})
|
||||
|
||||
uni.previewImage({
|
||||
urls: previewImages, // 需要预览的图片链接列表
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 转换时间单位
|
||||
* @param {Object} time
|
||||
@ -435,7 +449,25 @@
|
||||
* 报名
|
||||
*/
|
||||
goReport() {
|
||||
this.$tab.navigateTo('/pages/notice/report')
|
||||
getSignCard({
|
||||
noticeId: this.noticeId
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.canUserNum > 0) {
|
||||
this.$tab.navigateTo('/pages/notice/report')
|
||||
} else {
|
||||
this.$refs.alertDialog.open()
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
}).catch((e) => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
title: e
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 分享
|
||||
@ -823,4 +855,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,130 +1,130 @@
|
||||
<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="dataObj.bloggerTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'bloggerTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<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="dataObj.platformCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'platformCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">结算方式</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in noticeTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="dataObj.noticeTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'noticeTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">关键词<text>包含以下关键词的通告将被收入订阅</text></view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<view class="keywords-item" v-for="(item,index) in dataObj.keywordsList">
|
||||
{{checkKeywords(item)}} <uni-icons class="icon-text" type="closeempty" size="13"
|
||||
@click="delKeywords(item)"></uni-icons>
|
||||
</view>
|
||||
<view class="keywords-item" @click="addNewKeys()">
|
||||
<uni-icons type="plusempty" size="13"></uni-icons>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">粉丝</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<uni-data-select v-model="dataObj.fansLimit" :localdata="range" @change="change($event,'fans')"
|
||||
:clear="false"></uni-data-select>
|
||||
</view>
|
||||
<view class="line-row" v-show="dataObj.fansLimit">
|
||||
<view class="dl-drawer-item">
|
||||
<input class="uni-input" v-model="dataObj.fansDown" type="digit" placeholder="最低" />
|
||||
<view>—</view>
|
||||
<input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高" />
|
||||
<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="dataObj.bloggerTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'bloggerTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">奖励</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in rewardTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="dataObj.rewardTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'rewardTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">稿费要求</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<uni-data-select v-model="dataObj.feeLimit" :localdata="range" @change="change($event,'fee')"
|
||||
:clear="false"></uni-data-select>
|
||||
</view>
|
||||
<view class="line-row" v-show="dataObj.feeLimit">
|
||||
<view class="dl-drawer-item">
|
||||
<input class="uni-input" v-model="dataObj.feeDown" type="digit" placeholder="最低" />
|
||||
<view>—</view>
|
||||
<input class="uni-input" v-model="dataObj.feeUp" type="digit" placeholder="最高" />
|
||||
<view class="line-box">
|
||||
<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="dataObj.platformCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'platformCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">推送</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<view class="seting-view"><text>符合订阅设置的新通告</text>
|
||||
<switch v-if="dataObj.newNotice" style="float: right;display: flex;" checked color="#FC1F3E"
|
||||
@change="switchChange($event,'newNotice')" />
|
||||
<switch v-else style="float: right;display: flex;" color="#FC1F3E"
|
||||
@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-else style="float: right;display: flex;" color="#FC1F3E"
|
||||
@change="switchChange($event,'forkNotice')" />
|
||||
<view class="line-box">
|
||||
<view class="dl-title">结算方式</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in settleTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="dataObj.settleTypeCode==t.code?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'settleTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">关键词<text>包含以下关键词的通告将被收入订阅</text></view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<view class="keywords-item" v-for="(item,index) in dataObj.keywordsList">
|
||||
{{checkKeywords(item)}} <uni-icons class="icon-text" type="closeempty" size="13"
|
||||
@click="delKeywords(item)"></uni-icons>
|
||||
</view>
|
||||
<view class="keywords-item" @click="addNewKeys()">
|
||||
<uni-icons type="plusempty" size="13"></uni-icons>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">粉丝</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<uni-data-select v-model="dataObj.fansLimit" :localdata="range" @change="change($event,'fans')"
|
||||
:clear="false"></uni-data-select>
|
||||
</view>
|
||||
<view class="line-row" v-show="dataObj.fansLimit">
|
||||
<view class="dl-drawer-item">
|
||||
<input class="uni-input" v-model="dataObj.fansDown" type="digit" placeholder="最低" />
|
||||
<view>—</view>
|
||||
<input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="line-box">
|
||||
<view class="dl-title">奖励</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row" v-for="(item,index) in rewardTypeList">
|
||||
<view v-for="(t,i) in item"
|
||||
:class="dataObj.rewardTypeCode.indexOf(t.code)>-1?'line-item click':'line-item'"
|
||||
@click="changeChooseValue(t,'rewardTypeCode')">
|
||||
{{t.title}}
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="line-box">
|
||||
<view class="dl-title">稿费要求</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<uni-data-select v-model="dataObj.feeLimit" :localdata="range" @change="change($event,'fee')"
|
||||
:clear="false"></uni-data-select>
|
||||
</view>
|
||||
<view class="line-row" v-show="dataObj.feeLimit">
|
||||
<view class="dl-drawer-item">
|
||||
<input class="uni-input" v-model="dataObj.feeDown" type="digit" placeholder="最低" />
|
||||
<view>—</view>
|
||||
<input class="uni-input" v-model="dataObj.feeUp" type="digit" placeholder="最高" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box">
|
||||
<view class="dl-title">推送</view>
|
||||
<view class="dl-content">
|
||||
<view class="line-row">
|
||||
<view class="seting-view"><text>符合订阅设置的新通告</text>
|
||||
<switch v-if="dataObj.newNotice" style="float: right;display: flex;" checked color="#FC1F3E"
|
||||
@change="switchChange($event,'newNotice')" />
|
||||
<switch v-else style="float: right;display: flex;" color="#FC1F3E"
|
||||
@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-else style="float: right;display: flex;" color="#FC1F3E"
|
||||
@change="switchChange($event,'forkNotice')" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-box" style="align-items: center;">
|
||||
<view class="submit-box" @click="saveSet()">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
<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="请输入关键词"
|
||||
@ -155,16 +155,16 @@
|
||||
//博主分类
|
||||
bloggerTypeList: [],
|
||||
//通告类型--这个只能固定死
|
||||
noticeTypeList: [
|
||||
settleTypeList: [
|
||||
[{
|
||||
code: "-1",
|
||||
title: "不限"
|
||||
}, {
|
||||
code: "money",
|
||||
title: "高奖励"
|
||||
code: "0",
|
||||
title: "普通结算"
|
||||
}, {
|
||||
code: "gift",
|
||||
title: "品牌置换"
|
||||
code: "1",
|
||||
title: "平台结算"
|
||||
}]
|
||||
],
|
||||
//奖励--这个只能固定死
|
||||
@ -184,7 +184,7 @@
|
||||
dataObj: {
|
||||
bloggerTypeCode: [],
|
||||
platformCode: [],
|
||||
noticeTypeCode: [],
|
||||
settleTypeCode: '',
|
||||
//关键词集和
|
||||
keywordsList: [],
|
||||
rewardTypeCode: [],
|
||||
@ -324,7 +324,12 @@
|
||||
* @param {Object} key
|
||||
*/
|
||||
changeChooseValue(item, key) {
|
||||
console.log(item, 320);
|
||||
|
||||
if (key == 'settleTypeCode') {
|
||||
this.dataObj[key] = item.code
|
||||
console.log(this.dataObj[key], 320);
|
||||
return
|
||||
}
|
||||
if (item.code == '-1') {
|
||||
this.dataObj[key] = []
|
||||
this.dataObj[key].push(item.code)
|
||||
|
@ -1,183 +0,0 @@
|
||||
<template>
|
||||
<view class="work-container">
|
||||
<!-- 轮播图 -->
|
||||
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
||||
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
||||
<swiper-item v-for="(item, index) in data" :key="index">
|
||||
<view class="swiper-item" @click="clickBannerItem(item)">
|
||||
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</uni-swiper-dot>
|
||||
|
||||
<!-- 宫格组件 -->
|
||||
<uni-section title="系统管理" type="line"></uni-section>
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
||||
<text class="text">用户管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="staff-filled" size="30"></uni-icons>
|
||||
<text class="text">角色管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="color" size="30"></uni-icons>
|
||||
<text class="text">菜单管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="settings-filled" size="30"></uni-icons>
|
||||
<text class="text">部门管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="heart-filled" size="30"></uni-icons>
|
||||
<text class="text">岗位管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="bars" size="30"></uni-icons>
|
||||
<text class="text">字典管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="gear-filled" size="30"></uni-icons>
|
||||
<text class="text">参数设置</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="chat-filled" size="30"></uni-icons>
|
||||
<text class="text">通知公告</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
||||
<text class="text">日志管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
swiperDotIndex: 0,
|
||||
data: [{
|
||||
image: '/static/images/banner/banner01.jpg'
|
||||
},
|
||||
{
|
||||
image: '/static/images/banner/banner02.jpg'
|
||||
},
|
||||
{
|
||||
image: '/static/images/banner/banner03.jpg'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickBannerItem(item) {
|
||||
console.info(item)
|
||||
},
|
||||
changeSwiper(e) {
|
||||
this.current = e.detail.current
|
||||
},
|
||||
changeGrid(e) {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* #ifndef APP-NVUE */
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
min-height: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 14px;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.grid-item-box {
|
||||
flex: 1;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.uni-margin-wrap {
|
||||
width: 690rpx;
|
||||
width: 100%;
|
||||
;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
height: 300rpx;
|
||||
line-height: 300rpx;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 500px) {
|
||||
.uni-swiper-dot-box {
|
||||
width: 400px;
|
||||
/* #ifndef APP-NVUE */
|
||||
margin: 0 auto;
|
||||
/* #endif */
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,183 +0,0 @@
|
||||
<template>
|
||||
<view class="work-container">
|
||||
<!-- 轮播图 -->
|
||||
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
||||
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
||||
<swiper-item v-for="(item, index) in data" :key="index">
|
||||
<view class="swiper-item" @click="clickBannerItem(item)">
|
||||
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</uni-swiper-dot>
|
||||
|
||||
<!-- 宫格组件 -->
|
||||
<uni-section title="系统管理" type="line"></uni-section>
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
||||
<text class="text">用户管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="staff-filled" size="30"></uni-icons>
|
||||
<text class="text">角色管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="color" size="30"></uni-icons>
|
||||
<text class="text">菜单管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="settings-filled" size="30"></uni-icons>
|
||||
<text class="text">部门管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="heart-filled" size="30"></uni-icons>
|
||||
<text class="text">岗位管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="bars" size="30"></uni-icons>
|
||||
<text class="text">字典管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="gear-filled" size="30"></uni-icons>
|
||||
<text class="text">参数设置</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="chat-filled" size="30"></uni-icons>
|
||||
<text class="text">通知公告</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
<view class="grid-item-box">
|
||||
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
||||
<text class="text">日志管理</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
swiperDotIndex: 0,
|
||||
data: [{
|
||||
image: '/static/images/banner/banner01.jpg'
|
||||
},
|
||||
{
|
||||
image: '/static/images/banner/banner02.jpg'
|
||||
},
|
||||
{
|
||||
image: '/static/images/banner/banner03.jpg'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickBannerItem(item) {
|
||||
console.info(item)
|
||||
},
|
||||
changeSwiper(e) {
|
||||
this.current = e.detail.current
|
||||
},
|
||||
changeGrid(e) {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* #ifndef APP-NVUE */
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
min-height: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 14px;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.grid-item-box {
|
||||
flex: 1;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.uni-margin-wrap {
|
||||
width: 690rpx;
|
||||
width: 100%;
|
||||
;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
height: 300rpx;
|
||||
line-height: 300rpx;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 500px) {
|
||||
.uni-swiper-dot-box {
|
||||
width: 400px;
|
||||
/* #ifndef APP-NVUE */
|
||||
margin: 0 auto;
|
||||
/* #endif */
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
BIN
static/detail/haibao.png
Normal file
BIN
static/detail/haibao.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
static/detail/jubao.png
Normal file
BIN
static/detail/jubao.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
static/detail/weixin.png
Normal file
BIN
static/detail/weixin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
static/mine/erweima.jpg
Normal file
BIN
static/mine/erweima.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
@ -4,13 +4,13 @@
|
||||
<text class="file-title">{{ title }}</text>
|
||||
<text class="file-count">{{ filesList.length }}/{{ limitLength }}</text>
|
||||
</view>
|
||||
<upload-image v-if="fileMediatype === 'image' && showType === 'grid'" :readonly="readonly"
|
||||
<upload-image :small="small" v-if="fileMediatype === 'image' && showType === 'grid'" :readonly="readonly"
|
||||
:image-styles="imageStyles" :files-list="filesList" :limit="limitLength" :disablePreview="disablePreview"
|
||||
:delIcon="delIcon" @uploadFiles="uploadFiles" @choose="choose" @delFile="delFile">
|
||||
<slot>
|
||||
<view class="is-add">
|
||||
<view class="icon-add"></view>
|
||||
<view class="icon-add rotate"></view>
|
||||
<view :class="['icon-add',small?'new-icon-add':'']"></view>
|
||||
<view :class="['icon-add rotate',small?'new-icon-add':'']"></view>
|
||||
</view>
|
||||
</slot>
|
||||
</upload-image>
|
||||
@ -115,6 +115,10 @@
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
delIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@ -189,7 +193,7 @@
|
||||
sourceType: {
|
||||
type: Array,
|
||||
default () {
|
||||
return ['album', 'camera']
|
||||
return ['album', 'camera']
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -290,19 +294,19 @@
|
||||
return this.uploadFiles(files)
|
||||
},
|
||||
async setValue(newVal, oldVal) {
|
||||
const newData = async (v) => {
|
||||
const newData = async (v) => {
|
||||
const reg = /cloud:\/\/([\w.]+\/?)\S*/
|
||||
let url = ''
|
||||
if(v.fileID){
|
||||
if (v.fileID) {
|
||||
url = v.fileID
|
||||
}else{
|
||||
} else {
|
||||
url = v.url
|
||||
}
|
||||
if (reg.test(url)) {
|
||||
v.fileID = url
|
||||
v.url = await this.getTempFileURL(url)
|
||||
}
|
||||
if(v.url) v.path = v.url
|
||||
if (v.url) v.path = v.url
|
||||
return v
|
||||
}
|
||||
if (this.returnType === 'object') {
|
||||
@ -313,13 +317,13 @@
|
||||
}
|
||||
} else {
|
||||
if (!newVal) newVal = []
|
||||
for(let i =0 ;i < newVal.length ;i++){
|
||||
for (let i = 0; i < newVal.length; i++) {
|
||||
let v = newVal[i]
|
||||
await newData(v)
|
||||
}
|
||||
}
|
||||
this.localValue = newVal
|
||||
if (this.form && this.formItem &&!this.is_reset) {
|
||||
if (this.form && this.formItem && !this.is_reset) {
|
||||
this.is_reset = false
|
||||
this.formItem.setValue(this.localValue)
|
||||
}
|
||||
@ -464,7 +468,7 @@
|
||||
const reg = /cloud:\/\/([\w.]+\/?)\S*/
|
||||
if (reg.test(item.url)) {
|
||||
this.files[index].url = await this.getTempFileURL(item.url)
|
||||
}else{
|
||||
} else {
|
||||
this.files[index].url = item.url
|
||||
}
|
||||
|
||||
@ -552,7 +556,7 @@
|
||||
let data = []
|
||||
if (this.returnType === 'object') {
|
||||
data = this.backObject(this.files)[0]
|
||||
this.localValue = data?data:null
|
||||
this.localValue = data ? data : null
|
||||
} else {
|
||||
data = this.backObject(this.files)
|
||||
if (!this.localValue) {
|
||||
@ -582,12 +586,12 @@
|
||||
name: v.name,
|
||||
path: v.path,
|
||||
size: v.size,
|
||||
fileID:v.fileID,
|
||||
fileID: v.fileID,
|
||||
url: v.url,
|
||||
// 修改删除一个文件后不能再上传的bug, #694
|
||||
uuid: v.uuid,
|
||||
status: v.status,
|
||||
cloudPath: v.cloudPath
|
||||
uuid: v.uuid,
|
||||
status: v.status,
|
||||
cloudPath: v.cloudPath
|
||||
})
|
||||
})
|
||||
return newFilesData
|
||||
@ -660,8 +664,12 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.new-icon-add {
|
||||
width: 30px !important;
|
||||
}
|
||||
|
||||
.rotate {
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -2,14 +2,16 @@
|
||||
<view class="uni-file-picker__container">
|
||||
<view class="file-picker__box" v-for="(item,index) in filesList" :key="index" :style="boxStyle">
|
||||
<view class="file-picker__box-content" :style="borderStyle">
|
||||
<image class="file-image" :src="item.url" mode="aspectFill" @click.stop="prviewImage(item,index)"></image>
|
||||
<image class="file-image" :src="item.url" mode="aspectFill" @click.stop="prviewImage(item,index)">
|
||||
</image>
|
||||
<view v-if="delIcon && !readonly" class="icon-del-box" @click.stop="delFile(index)">
|
||||
<view class="icon-del"></view>
|
||||
<view class="icon-del rotate"></view>
|
||||
</view>
|
||||
<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
|
||||
<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
|
||||
:backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
|
||||
<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 "
|
||||
class="file-picker__progress">
|
||||
<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress"
|
||||
stroke-width="4" :backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
|
||||
</view>
|
||||
<view v-if="item.errMsg" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
|
||||
点击重试
|
||||
@ -19,8 +21,8 @@
|
||||
<view v-if="filesList.length < limit && !readonly" class="file-picker__box" :style="boxStyle">
|
||||
<view class="file-picker__box-content is-add" :style="borderStyle" @click="choose">
|
||||
<slot>
|
||||
<view class="icon-add"></view>
|
||||
<view class="icon-add rotate"></view>
|
||||
<view :class="['icon-add',small?'new-icon-add':'']"></view>
|
||||
<view :class="['icon-add rotate',small?'new-icon-add':'']"></view>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
@ -30,7 +32,7 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "uploadImage",
|
||||
emits:['uploadFiles','choose','delFile'],
|
||||
emits: ['uploadFiles', 'choose', 'delFile'],
|
||||
props: {
|
||||
filesList: {
|
||||
type: Array,
|
||||
@ -38,7 +40,11 @@
|
||||
return []
|
||||
}
|
||||
},
|
||||
disabled:{
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
@ -64,9 +70,9 @@
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
readonly:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -100,15 +106,21 @@
|
||||
if (height !== 'auto') {
|
||||
obj.width = this.value2px(height)
|
||||
} else {
|
||||
obj.width = '33.3%'
|
||||
if (true == this.small) {
|
||||
obj.width = '25%'
|
||||
obj['padding-top'] = '25%'
|
||||
} else {
|
||||
obj.width = '33.3%'
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
obj.width = this.value2px(width)
|
||||
}
|
||||
|
||||
let classles = ''
|
||||
for(let i in obj){
|
||||
classles+= `${i}:${obj[i]};`
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`
|
||||
}
|
||||
return classles
|
||||
},
|
||||
@ -134,8 +146,8 @@
|
||||
}
|
||||
}
|
||||
let classles = ''
|
||||
for(let i in obj){
|
||||
classles+= `${i}:${obj[i]};`
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`
|
||||
}
|
||||
return classles
|
||||
}
|
||||
@ -152,10 +164,10 @@
|
||||
},
|
||||
prviewImage(img, index) {
|
||||
let urls = []
|
||||
if(Number(this.limit) === 1&&this.disablePreview&&!this.disabled){
|
||||
if (Number(this.limit) === 1 && this.disablePreview && !this.disabled) {
|
||||
this.$emit("choose")
|
||||
}
|
||||
if(this.disablePreview) return
|
||||
if (this.disablePreview) return
|
||||
this.filesList.forEach(i => {
|
||||
urls.push(i.url)
|
||||
})
|
||||
@ -261,6 +273,10 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.new-icon-add {
|
||||
width: 30px !important;
|
||||
}
|
||||
|
||||
.rotate {
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
@ -289,4 +305,4 @@
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -465,7 +465,7 @@
|
||||
padding-bottom: 20rpx;
|
||||
/* #endif */
|
||||
/* #ifndef APP-NVUE */
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 50rpx;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
|
||||
|
@ -45,17 +45,17 @@
|
||||
return {
|
||||
bottomData: [{
|
||||
text: '微信',
|
||||
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
|
||||
icon: '/static/detail/weixin.png',
|
||||
name: 'wx'
|
||||
},
|
||||
{
|
||||
text: '海报',
|
||||
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
|
||||
icon: '/static/detail/haibao.png',
|
||||
name: 'hb'
|
||||
},
|
||||
{
|
||||
text: '举报',
|
||||
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
|
||||
icon: '/static/detail/jubao.png',
|
||||
name: 'jb'
|
||||
},
|
||||
// {
|
||||
|
Loading…
Reference in New Issue
Block a user