修改页面样式等
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Date: 2025-10-31 11:06:15
|
* @Date: 2025-10-31 11:06:15
|
||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-11-03 14:31:12
|
* @LastEditTime: 2025-11-03 15:51:28
|
||||||
*/
|
*/
|
||||||
import request from '@/utilsRc/request'
|
import request from '@/utilsRc/request'
|
||||||
|
|
||||||
@@ -44,4 +44,10 @@ export function register(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取用户详细信息
|
||||||
|
export function getInfo() {
|
||||||
|
return request({
|
||||||
|
url: '/getInfo',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
6
main.js
6
main.js
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Date: 2025-11-03 10:52:09
|
* @Date: 2025-11-03 10:52:09
|
||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-11-03 12:12:49
|
* @LastEditTime: 2025-11-03 17:26:29
|
||||||
*/
|
*/
|
||||||
import App from '@/App'
|
import App from '@/App'
|
||||||
import * as Pinia from 'pinia'
|
import * as Pinia from 'pinia'
|
||||||
@@ -21,6 +21,8 @@ import RenderCompanys from '@/components/renderCompanys/renderCompanys.vue';
|
|||||||
import uniIcons from './uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
import uniIcons from './uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||||
import uniPopup from './uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
|
import uniPopup from './uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
|
||||||
import uniDataSelect from './uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
|
import uniDataSelect from './uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
|
||||||
|
import uniSwipeAction from './uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue'
|
||||||
|
import uniSwipeActionItem from './uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue'
|
||||||
import storeRc from './utilsRc/store/index.js'
|
import storeRc from './utilsRc/store/index.js'
|
||||||
// iconfont.css 已在 App.vue 中通过 @import 引入,无需在此处重复引入
|
// iconfont.css 已在 App.vue 中通过 @import 引入,无需在此处重复引入
|
||||||
// import Tabbar from '@/components/tabbar/midell-box.vue'
|
// import Tabbar from '@/components/tabbar/midell-box.vue'
|
||||||
@@ -51,6 +53,8 @@ export function createApp() {
|
|||||||
app.component('uni-icons', uniIcons)
|
app.component('uni-icons', uniIcons)
|
||||||
app.component('uni-popup', uniPopup)
|
app.component('uni-popup', uniPopup)
|
||||||
app.component('uni-data-select', uniDataSelect)
|
app.component('uni-data-select', uniDataSelect)
|
||||||
|
app.component('uni-swipe-action', uniSwipeAction)
|
||||||
|
app.component('uni-swipe-action-item', uniSwipeActionItem)
|
||||||
|
|
||||||
|
|
||||||
app.config.globalProperties.$getDict = getDict;
|
app.config.globalProperties.$getDict = getDict;
|
||||||
|
|||||||
11
package-lock.json
generated
11
package-lock.json
generated
@@ -5,10 +5,16 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dcloudio/uni-ui": "^1.5.11",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"sm-crypto": "^0.3.13"
|
"sm-crypto": "^0.3.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@dcloudio/uni-ui": {
|
||||||
|
"version": "1.5.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
|
||||||
|
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
|
||||||
|
},
|
||||||
"node_modules/dayjs": {
|
"node_modules/dayjs": {
|
||||||
"version": "1.11.19",
|
"version": "1.11.19",
|
||||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
||||||
@@ -29,6 +35,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dcloudio/uni-ui": {
|
||||||
|
"version": "1.5.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
|
||||||
|
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
|
||||||
|
},
|
||||||
"dayjs": {
|
"dayjs": {
|
||||||
"version": "1.11.19",
|
"version": "1.11.19",
|
||||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dcloudio/uni-ui": "^1.5.11",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"sm-crypto": "^0.3.13"
|
"sm-crypto": "^0.3.13"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2025-10-16 15:15:47
|
* @Date: 2025-10-16 15:15:47
|
||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-10-31 14:56:32
|
* @LastEditTime: 2025-11-03 17:41:33
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
@@ -51,13 +51,13 @@
|
|||||||
<view>共 {{jobList1count}}条信息</view>
|
<view>共 {{jobList1count}}条信息</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item, index) in jobList1" :key="index" class="job-list">
|
<view v-for="(item, index) in jobList1" :key="index" class="job-list">
|
||||||
<view class="title">销售顾问</view>
|
<view class="title">{{ item.personName }} {{ item.deptName }}</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
待办内容文字示例待办内容文字示例待办内容文字示例待办内容文字示例
|
{{getDictLabel(item.demandType, qcjy_xqlx)}}_{{ item.jobDescription }}
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-line">
|
<view class="bottom-line">
|
||||||
<view>发起时间:2025-09-24 15:02</view>
|
<view>发起时间:{{item.createTime}}</view>
|
||||||
<view style="color: #EF7325;">青岛xx公司</view>
|
<view style="color: #EF7325;">{{getDictLabel(item.currentStatus, qcjy_xqlc)}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="titles">
|
<view class="titles">
|
||||||
@@ -70,22 +70,26 @@
|
|||||||
<image v-else src="../../../packageRc/static/personIconFe.png"/>
|
<image v-else src="../../../packageRc/static/personIconFe.png"/>
|
||||||
<view class="top-right">
|
<view class="top-right">
|
||||||
<view class="name-line">
|
<view class="name-line">
|
||||||
<view class="name">姓名<view class="tag">{{item.name}}</view></view>
|
<view class="name">{{item.name}}<view class="tag">{{item.zy}}</view></view>
|
||||||
<view class="service-status">·未服务</view>
|
<view class="service-status" v-if="item.fwzt == 0">•未服务</view>
|
||||||
|
<view class="service-status" v-if="item.fwzt == 1">•已服务</view>
|
||||||
|
<view class="service-status" v-if="item.fwzt == 2">•联系不上</view>
|
||||||
|
<view class="service-status" v-if="item.fwzt == 3">•拒绝服务</view>
|
||||||
|
<view class="service-status" v-if="item.isReturn == 1">•被退回</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-line" style="display: flex;">
|
<view class="info-line" style="display: flex;">
|
||||||
<view style="margin-right: 24rpx;"><text>年龄:</text>27岁</view>
|
<view style="margin-right: 24rpx;"><text>年龄:</text>{{item.age}}岁</view>
|
||||||
<view><text>服务次数:</text>1次</view>
|
<view><text>服务次数:</text>{{item.operateNum}}次</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-line">
|
<view class="info-line">
|
||||||
<view><text>联系电话:</text>152****5488</view>
|
<view><text>联系电话:</text>{{item.phone || '--'}}</view>
|
||||||
<view><text>详细地址:</text>{{item.xxdz}}</view>
|
<view><text>详细地址:</text>{{item.xxdz}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="services">
|
<view class="services">
|
||||||
<view @click="showReturnReasonPopup(item.id)">退回</view>
|
<view @click="showReturnReasonPopup(item.id)">退回</view>
|
||||||
<view @click="tiao(item.id,item.name)">服务</view>
|
<view @click="tiao(item)">服务</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -139,11 +143,23 @@ function back() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
let qcjy_xqlx = ref([])
|
||||||
|
let qcjy_xqlc = ref([])
|
||||||
|
import {getDicts} from '@/apiRc/system/dict'
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getlist();
|
getlist();
|
||||||
getlistyujing();
|
getlistyujing();
|
||||||
|
getDicts('qcjy_xqlx').then(res => {
|
||||||
|
qcjy_xqlx.value = res.data
|
||||||
|
});
|
||||||
|
getDicts('qcjy_xqlc').then(res => {
|
||||||
|
qcjy_xqlc.value = res.data
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
function getDictLabel(value, list) {
|
||||||
|
const item = list.find(item => item.dictValue === value);
|
||||||
|
return item ? item.dictLabel : '';
|
||||||
|
}
|
||||||
async function getlist(){
|
async function getlist(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -180,11 +196,11 @@ function showReturnReasonPopup(dd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tiao(id,name){
|
function tiao(item){
|
||||||
console.log('尝试导航到待办详情页面,ID:', id);
|
console.log('尝试导航到待办详情页面,ID:', item.id, item.userId);
|
||||||
// 尝试直接使用uni.navigateTo,使用正确的格式并传递id参数
|
// 尝试直接使用uni.navigateTo,使用正确的格式并传递id参数
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/packageRc/pages/daiban/daibandetail?id=${id}&name=${name}`,
|
url: `/packageRc/pages/daiban/daibandetail?id=${item.id}&name=${item.name}&userId=${item.userId}`,
|
||||||
success: function() {
|
success: function() {
|
||||||
console.log('导航成功');
|
console.log('导航成功');
|
||||||
},
|
},
|
||||||
@@ -555,12 +571,14 @@ view{box-sizing: border-box;display: block;}
|
|||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
background: #4D89E3;
|
background: #4D89E3;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.service-status{
|
.service-status{
|
||||||
color: #E0A61F;
|
color: #E0A61F;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info-line{
|
.info-line{
|
||||||
|
|||||||
@@ -1,34 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="job-list">
|
<view class="job-list" style="background-image: url('../../../packageRc/static/pageBg.png');">
|
||||||
<view class="top_box_bg">
|
|
||||||
<u-image src="@/packageRc/static/images/top.png" width="750rpx" height="496rpx" />
|
|
||||||
</view>
|
|
||||||
<view class="job-list__navbar">
|
|
||||||
<div class="navbar">
|
|
||||||
<view class="navbar-left" @click="goBack">
|
|
||||||
<uni-icons name="back" color="#fff" size="36"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="navbar-title" style="color: #fff">服务详情</view>
|
|
||||||
<view class="navbar-right">
|
|
||||||
<!-- 注释掉store相关引用,避免getters错误 -->
|
|
||||||
<!--
|
|
||||||
<uni-icons
|
|
||||||
v-show="false"
|
|
||||||
@tap=""
|
|
||||||
name="list"
|
|
||||||
size="44rpx"
|
|
||||||
color="#fff"
|
|
||||||
></uni-icons>
|
|
||||||
-->
|
|
||||||
</view>
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<view class="job-list__content">
|
<view class="job-list__content">
|
||||||
<img
|
<image
|
||||||
class="top_box_bg_service"
|
class="top_box_bg_service"
|
||||||
src=""
|
src="/packageRc/static/images/serviceFrequency.png"
|
||||||
width="360rpx"
|
style="width:calc(100vw - 64rpx);height:80rpx;display: block;"
|
||||||
height="50rpx"
|
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<view class="serviceFrequency" @tap="
|
<view class="serviceFrequency" @tap="
|
||||||
@@ -40,7 +16,7 @@
|
|||||||
<view
|
<view
|
||||||
|
|
||||||
style="font-size: 28rpx; font-weight: normal"
|
style="font-size: 28rpx; font-weight: normal"
|
||||||
>查看></view
|
>{{'查看>'}}</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
@@ -81,10 +57,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="visitAndInvestigate" @click="goAddServices">
|
<view class="visitAndInvestigate" @click="goAddServices">
|
||||||
<view class="text">服务</view>
|
<view class="text">服务</view>
|
||||||
<img
|
<image
|
||||||
src="/packageRc/static/images/person/fillInRecords.png"
|
src="/packageRc/static/images/person/fillInRecords.png"
|
||||||
width="60rpx"
|
style="width:220rpx;height:60rpx;"
|
||||||
height="40rpx"
|
|
||||||
alt=""
|
alt=""
|
||||||
srcset=""
|
srcset=""
|
||||||
/>
|
/>
|
||||||
@@ -128,15 +103,16 @@
|
|||||||
>条求职需求</text
|
>条求职需求</text
|
||||||
>
|
>
|
||||||
</view> -->
|
</view> -->
|
||||||
<u-swipe-action v-show="activeType == 1">
|
<uni-swipe-action v-show="activeType == 1">
|
||||||
<u-swipe-action-item
|
<uni-swipe-action-item
|
||||||
:options="[{ text: '删除' }]"
|
:right-options="[{ text: '删除' }]"
|
||||||
class="jobSearchListview"
|
class="jobSearchListview"
|
||||||
v-for="item in jobSearchList"
|
v-for="item in jobSearchList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@click="removeRowData(item)"
|
@click="removeRowData(item)"
|
||||||
>
|
>
|
||||||
<view style="padding: 30rpx;" @click="goNeedsDetail(item, 1)">
|
<view>
|
||||||
|
<view style="border-radius: 8rpx;margin-top: 16rpx;background: #fff;padding: 30rpx;" @click="goNeedsDetail(item, 1)">
|
||||||
<view class="jobSearchListview_name">{{
|
<view class="jobSearchListview_name">{{
|
||||||
getJobWorkTypeName(item.jobWorkType)
|
getJobWorkTypeName(item.jobWorkType)
|
||||||
}}</view>
|
}}</view>
|
||||||
@@ -186,8 +162,9 @@
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action-item>
|
</view>
|
||||||
</u-swipe-action>
|
</uni-swipe-action-item>
|
||||||
|
</uni-swipe-action>
|
||||||
<!-- <view class="requirementTitle">
|
<!-- <view class="requirementTitle">
|
||||||
<text>创业需求</text>
|
<text>创业需求</text>
|
||||||
<text class="text"
|
<text class="text"
|
||||||
@@ -197,15 +174,15 @@
|
|||||||
>条求职需求</text
|
>条求职需求</text
|
||||||
>
|
>
|
||||||
</view> -->
|
</view> -->
|
||||||
<u-swipe-action v-show="activeType == 2">
|
<uni-swipe-action v-show="activeType == 2">
|
||||||
<u-swipe-action-item
|
<uni-swipe-action-item
|
||||||
:options="[{ text: '删除' }]"
|
:right-options="[{ text: '删除' }]"
|
||||||
@click="removeRowData(item)"
|
@click="removeRowData(item)"
|
||||||
class="entrepreneurialNeeds"
|
class="entrepreneurialNeeds"
|
||||||
v-for="item in listOfEntrepreneurialNeeds"
|
v-for="item in listOfEntrepreneurialNeeds"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<view style="padding: 30rpx" @click="goNeedsDetail(item, 3)">
|
<view style="border-radius: 8rpx;margin-top: 16rpx;background: #fff;padding: 30rpx" @click="goNeedsDetail(item, 3)">
|
||||||
<view class="entrepreneurialNeeds_name">
|
<view class="entrepreneurialNeeds_name">
|
||||||
{{ item.personName }}的创业需求
|
{{ item.personName }}的创业需求
|
||||||
</view>
|
</view>
|
||||||
@@ -251,8 +228,8 @@
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
</u-swipe-action>
|
</uni-swipe-action>
|
||||||
<!-- <view class="requirementTitle">
|
<!-- <view class="requirementTitle">
|
||||||
<text>培训需求</text>
|
<text>培训需求</text>
|
||||||
<text class="text"
|
<text class="text"
|
||||||
@@ -260,15 +237,15 @@
|
|||||||
>条求职需求</text
|
>条求职需求</text
|
||||||
>
|
>
|
||||||
</view> -->
|
</view> -->
|
||||||
<u-swipe-action v-show="activeType == 3">
|
<uni-swipe-action v-show="activeType == 3">
|
||||||
<u-swipe-action-item
|
<uni-swipe-action-item
|
||||||
:options="[{ text: '删除' }]"
|
:right-options="[{ text: '删除' }]"
|
||||||
@click="removeRowData(item)"
|
@click="removeRowData(item)"
|
||||||
class="entrepreneurialNeeds"
|
class="entrepreneurialNeeds"
|
||||||
v-for="item in trainingList"
|
v-for="item in trainingList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<view style="padding: 30rpx" @click="goNeedsDetail(item, 4)">
|
<view style="border-radius: 8rpx;margin-top: 16rpx;background: #fff;padding: 30rpx" @click="goNeedsDetail(item, 4)">
|
||||||
<view class="entrepreneurialNeeds_name">
|
<view class="entrepreneurialNeeds_name">
|
||||||
{{ item.personName }}的培训需求
|
{{ item.personName }}的培训需求
|
||||||
</view>
|
</view>
|
||||||
@@ -316,8 +293,8 @@
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
</u-swipe-action>
|
</uni-swipe-action>
|
||||||
<!-- <view class="requirementTitle">
|
<!-- <view class="requirementTitle">
|
||||||
<text>其他需求</text>
|
<text>其他需求</text>
|
||||||
<text class="text"
|
<text class="text"
|
||||||
@@ -325,15 +302,15 @@
|
|||||||
>条其他需求</text
|
>条其他需求</text
|
||||||
>
|
>
|
||||||
</view> -->
|
</view> -->
|
||||||
<u-swipe-action v-show="activeType == 4">
|
<uni-swipe-action v-show="activeType == 4">
|
||||||
<u-swipe-action-item
|
<uni-swipe-action-item
|
||||||
:options="[{ text: '删除' }]"
|
:options="[{ text: '删除' }]"
|
||||||
@click="removeRowData(item)"
|
@click="removeRowData(item)"
|
||||||
class="entrepreneurialNeeds"
|
class="entrepreneurialNeeds"
|
||||||
v-for="item in otherList"
|
v-for="item in otherList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<view style="padding: 30rpx" @click="goNeedsDetail(item, 5)">
|
<view style="border-radius: 8rpx;margin-top: 16rpx;background: #fff;padding: 30rpx" @click="goNeedsDetail(item, 5)">
|
||||||
<view class="entrepreneurialNeeds_name">
|
<view class="entrepreneurialNeeds_name">
|
||||||
{{ item.personName }}的其他需求
|
{{ item.personName }}的其他需求
|
||||||
</view>
|
</view>
|
||||||
@@ -378,15 +355,15 @@
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
</u-swipe-action>
|
</uni-swipe-action>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="addNeeds" @click="goAddNeeds">
|
<view class="addNeeds" @click="goAddNeeds">
|
||||||
<img src="/packageRc/static/images/person/addNeeds.png" />
|
<img src="/packageRc/static/images/person/addNeeds.png" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-popup :show="show" @close="close" @open="open">
|
<!-- <uni-popup ref="show" @close="close" @open="open">
|
||||||
<view class="dialog_div">
|
<view class="dialog_div">
|
||||||
<view class="dialog_div_item" @click="goAddNeeds(1)">
|
<view class="dialog_div_item" @click="goAddNeeds(1)">
|
||||||
<img
|
<img
|
||||||
@@ -428,10 +405,10 @@
|
|||||||
/>
|
/>
|
||||||
其他需求
|
其他需求
|
||||||
</view>
|
</view>
|
||||||
<view class="dialog_div_btn" @click="show = false"> 取 消 </view>
|
<view class="dialog_div_btn" @click="closeShow"> 取 消 </view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</uni-popup> -->
|
||||||
<u-datetime-picker
|
<!-- <u-datetime-picker
|
||||||
style="position: relative; z-index: 100"
|
style="position: relative; z-index: 100"
|
||||||
:show="showTime"
|
:show="showTime"
|
||||||
v-model="hopeSolveDate"
|
v-model="hopeSolveDate"
|
||||||
@@ -440,7 +417,7 @@
|
|||||||
@confirm="confirmDate"
|
@confirm="confirmDate"
|
||||||
@cancel="showTime = false"
|
@cancel="showTime = false"
|
||||||
@close="showTime = false"
|
@close="showTime = false"
|
||||||
></u-datetime-picker>
|
></u-datetime-picker> -->
|
||||||
<!-- 社区端 - 显示隐藏退出组件 -->
|
<!-- 社区端 - 显示隐藏退出组件 -->
|
||||||
<exitPopup />
|
<exitPopup />
|
||||||
</view>
|
</view>
|
||||||
@@ -528,7 +505,7 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.form.id = options.id;
|
this.form.id = options.id;
|
||||||
this.form.userId = options.name
|
this.form.userId = options.name
|
||||||
this.form.userId = options.id; // 确保userId被正确赋值
|
this.form.userId = options.userId; // 确保userId被正确赋值
|
||||||
console.log("options", options);
|
console.log("options", options);
|
||||||
this.getPersonInfo11();
|
this.getPersonInfo11();
|
||||||
|
|
||||||
@@ -622,8 +599,8 @@ export default {
|
|||||||
open() {
|
open() {
|
||||||
// console.log('open');
|
// console.log('open');
|
||||||
},
|
},
|
||||||
close() {
|
closeShow() {
|
||||||
this.show = false;
|
this.$refs.show.close();
|
||||||
// console.log('close');
|
// console.log('close');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -731,11 +708,8 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goAddNeeds(needsType) {
|
goAddNeeds() {
|
||||||
console.log("this.form.userId",this.form);
|
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
||||||
url: `/packageRc/pages/demand/demandail?activeType=${1}&id=${this.form.userId}&name=${this.form.name}`,
|
url: `/packageRc/pages/demand/demandail?activeType=${1}&id=${this.form.userId}&name=${this.form.name}`,
|
||||||
success: function() {
|
success: function() {
|
||||||
console.log('导航成功')
|
console.log('导航成功')
|
||||||
@@ -745,8 +719,6 @@ export default {
|
|||||||
console.error('导航失败:', err);
|
console.error('导航失败:', err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getDictLabel(value, list) {
|
getDictLabel(value, list) {
|
||||||
if (list) {
|
if (list) {
|
||||||
@@ -814,13 +786,13 @@ export default {
|
|||||||
// 需求推荐/培训
|
// 需求推荐/培训
|
||||||
requirementTraining(item, index) {
|
requirementTraining(item, index) {
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.$tab.navigateTo(
|
uni.navigateTo({
|
||||||
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&jobDemandInfoId=${item.id}&jobWorkType=${item.jobWorkType}&type=3&showTab=1`
|
url: `/packageRc/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&jobDemandInfoId=${item.id}&jobWorkType=${item.jobWorkType}&type=3&showTab=1`
|
||||||
);
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$tab.navigateTo(
|
uni.navigateTo({
|
||||||
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&skillTrainingId=${item.id}&personStatus=${item.personStatus}&type=4&showTab=1`
|
url: `/packageRc/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&skillTrainingId=${item.id}&personStatus=${item.personStatus}&type=4&showTab=1`
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeFile(e) {
|
changeFile(e) {
|
||||||
@@ -1013,15 +985,15 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.job-list {
|
.job-list {
|
||||||
&__navbar {
|
height: 100%;;
|
||||||
height: 80rpx;
|
background-repeat: no-repeat;
|
||||||
}
|
background-color: #F4F4F4;
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: #d0dcee;
|
background-color: #F4F4F4;
|
||||||
border-radius: 32rpx 32rpx 0 0;
|
border-radius: 32rpx 32rpx 0 0;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
}
|
}
|
||||||
@@ -1108,18 +1080,17 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding: 1rpx;
|
padding: 1rpx;
|
||||||
.content {
|
.content {
|
||||||
padding: 17px;
|
padding: 0 32rpx;
|
||||||
margin-top: 110rpx;
|
margin-top: 100rpx;
|
||||||
height: calc(100vh - 264rpx);
|
height: calc(100vh - 64rpx);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: #d0dcee;
|
// background-color: #d0dcee;
|
||||||
border-radius: 17px 17px 0 0;
|
// border-radius: 17px 17px 0 0;
|
||||||
border: 3px solid #fff !important;
|
// border: 3px solid #fff !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.top_box_bg_service {
|
.top_box_bg_service {
|
||||||
display:none;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20rpx;
|
top: 20rpx;
|
||||||
left: 40rpx;
|
left: 40rpx;
|
||||||
@@ -1212,6 +1183,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 205rpx;
|
height: 205rpx;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
border-top-right-radius: 0;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,439 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Date: 2024-10-09 17:07:39
|
|
||||||
* @LastEditors: lip
|
|
||||||
* @LastEditTime: 2025-05-07 09:34:25
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<view class="input-outer-part">
|
|
||||||
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 325rpx)':'calc(100vh - 200rpx)'}">
|
|
||||||
<view class="inner">
|
|
||||||
<view class="part-title" style="display: flex;justify-content: space-between;">需求信息
|
|
||||||
<view v-if="!edit&&formData.id&&formData.currentStatus!=3&&formData.currentStatus!=2" class="btn"
|
|
||||||
style="font-weight: normal;display: flex;" @click="edit=true">编辑<u-icon name="edit-pen"
|
|
||||||
color="#A6A6A6"></u-icon></view>
|
|
||||||
</view>
|
|
||||||
<view class="inner-part">
|
|
||||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm" class="self-form"
|
|
||||||
labelWidth="100">
|
|
||||||
<u-form-item label="姓名" prop="personName" required
|
|
||||||
v-if="$store.getters.roles.includes('shequn')|| $store.getters.roles.includes('gly')"
|
|
||||||
>
|
|
||||||
<view style="width: 100%; margin-left: 30rpx;" @click="openPersonChooser"
|
|
||||||
:class="{disabledLine: !edit||!canChoosePerson, noValue: !formData.personName}">
|
|
||||||
{{ formData.personName || '请选择' }}
|
|
||||||
</view>
|
|
||||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="需求说明" prop="demandDesc">
|
|
||||||
<u-textarea :disabled="!edit" v-model="formData.demandDesc" placeholder="请输入"></u-textarea>
|
|
||||||
</u-form-item>
|
|
||||||
<!-- <u-form-item label="需求标题" prop="demandTitle" required>
|
|
||||||
<u--textarea :disabled="!edit" v-model="formData.demandTitle" placeholder="请输入"
|
|
||||||
style="margin-left: 30rpx;"></u--textarea>
|
|
||||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
|
||||||
</u-form-item> -->
|
|
||||||
|
|
||||||
<!-- <u-form-item label="是否意向接受援助" prop="isAcceptAssistance" required>
|
|
||||||
<view style="margin-left: 30rpx;">
|
|
||||||
|
|
||||||
<u-radio-group :disabled="!edit" v-model="formData.isAcceptAssistance" placement="row">
|
|
||||||
<u-radio :customStyle="{marginRight: '16px'}" label="是" name="是"
|
|
||||||
value="1"></u-radio>
|
|
||||||
<u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"
|
|
||||||
value="0"></u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</view>
|
|
||||||
</u-form-item> -->
|
|
||||||
<!-- <u-form-item label="是否接受审批结果" prop="isAcceptApprovalResult" required>
|
|
||||||
<view style="margin-left: 30rpx;">
|
|
||||||
<u-radio-group :disabled="!edit" v-model="formData.isAcceptApprovalResult"
|
|
||||||
placement="row">
|
|
||||||
<u-radio :customStyle="{marginRight: '16px'}" label="是" name="是"
|
|
||||||
value="1"></u-radio>
|
|
||||||
<u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"
|
|
||||||
value="0"></u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</view>
|
|
||||||
</u-form-item> -->
|
|
||||||
<!-- <u-form-item label="希望解决日期" prop="hopeSolveDate" required>
|
|
||||||
<view style="width: 100%; margin-left: 30rpx;" @click="showPicker('hopeSolveDate')"
|
|
||||||
:class="{disabledLine: !edit, noValue: !formData.hopeSolveDate}">
|
|
||||||
{{ formData.hopeSolveDate||'请选择' }}
|
|
||||||
</view>
|
|
||||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
|
||||||
</u-form-item> -->
|
|
||||||
</u--form>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="inner" style="margin-top: 32rpx;">
|
|
||||||
<view class="inner-part">
|
|
||||||
<u--form labelPosition="left" class="self-form" labelWidth="110" ref="uForm" :model="formData"
|
|
||||||
:rules="rules">
|
|
||||||
<u-form-item label="需求说明" prop="demandDesc">
|
|
||||||
<u-textarea :disabled="!edit" v-model="formData.demandDesc" placeholder="请输入"></u-textarea>
|
|
||||||
</u-form-item>
|
|
||||||
</u--form>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- <view class="inner">
|
|
||||||
<view class="part-title" style="margin-top: 32rpx;">附件信息</view>
|
|
||||||
<view class="inner-part">
|
|
||||||
<u--form labelPosition="left" class="self-form" labelWidth="110">
|
|
||||||
<u-form-item label="附件" prop="fileUrl">
|
|
||||||
<ImageUpload :fileList="fileList" @update="changeFile" :maxCount="6" />
|
|
||||||
</u-form-item>
|
|
||||||
</u--form>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<!-- 办理完成后 需求说明 -->
|
|
||||||
<req-comp :form="{
|
|
||||||
actualSolveDate: formData.actualSolveDate,
|
|
||||||
actualSolvePeople: formData.actualSolvePeople,
|
|
||||||
solveDesc: formData.solveDesc,
|
|
||||||
fileUrl: formData.fileUrl
|
|
||||||
}" />
|
|
||||||
|
|
||||||
</scroll-view>
|
|
||||||
<u-datetime-picker :show="show.hopeSolveDate" v-model="dates.hopeSolveDate" mode="date"
|
|
||||||
@confirm="confirmDate('hopeSolveDate', $event)" @cancel="cancelPicker('hopeSolveDate')"></u-datetime-picker>
|
|
||||||
<choose-person ref="personChooser" @confirm="personNameConfirm" />
|
|
||||||
<view class="button-area" v-if="edit">
|
|
||||||
<view class="btn" @click="cancelPage">取消</view>
|
|
||||||
<view class="btn reset" @click="getDetail(formData.id)">重置</view>
|
|
||||||
<view class="btn save" @click="saveInfo">保存</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// import {
|
|
||||||
// getPersonBase
|
|
||||||
// } from "@/api/person";
|
|
||||||
// import {
|
|
||||||
// addAssistService,
|
|
||||||
// updateAssistService,
|
|
||||||
// getAssistService
|
|
||||||
// } from "@/api/needs/assistService";
|
|
||||||
// import ImageUpload from '@/components/ImageUpload'
|
|
||||||
// import ChoosePerson from '@/pages/needs/components/choosePerson';
|
|
||||||
// import dayjs from "dayjs";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
// ChoosePerson,
|
|
||||||
// ImageUpload,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
fileList: [],
|
|
||||||
edit: true,
|
|
||||||
personBase: {},
|
|
||||||
dates: {},
|
|
||||||
formData: {
|
|
||||||
demandDesc: ''
|
|
||||||
// demandTitle: '',
|
|
||||||
// isAcceptAssistance: '',
|
|
||||||
// isAcceptApprovalResult: '',
|
|
||||||
// personName: '',
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// demandTitle: [{
|
|
||||||
// required: true,
|
|
||||||
// message: '请填写需求标题',
|
|
||||||
// trigger: ['blur', 'change'],
|
|
||||||
// }, ],
|
|
||||||
// isAcceptAssistance: [{
|
|
||||||
// required: true,
|
|
||||||
// message: '请选择是否意向接受援助',
|
|
||||||
// trigger: ['blur', 'change'],
|
|
||||||
// }, ],
|
|
||||||
// isAcceptApprovalResult: [{
|
|
||||||
// required: true,
|
|
||||||
// message: '请选择是否接受审批结果',
|
|
||||||
// trigger: ['blur', 'change'],
|
|
||||||
// }, ],
|
|
||||||
// personName: [{
|
|
||||||
// required: true,
|
|
||||||
// message: '请填写姓名',
|
|
||||||
// trigger: ['blur', 'change'],
|
|
||||||
// }, ],
|
|
||||||
|
|
||||||
// hopeSolveDate: [{
|
|
||||||
// required: true,
|
|
||||||
// message: '请选择希望解决日期',
|
|
||||||
// trigger: ['blur', 'change'],
|
|
||||||
// }, ],
|
|
||||||
personName: [{
|
|
||||||
required: true,
|
|
||||||
message: '请填写姓名',
|
|
||||||
trigger: ['blur', 'change'],
|
|
||||||
}, ],
|
|
||||||
demandDesc: [{
|
|
||||||
required: true,
|
|
||||||
message: '请填写需求说明',
|
|
||||||
trigger: ['blur', 'change'],
|
|
||||||
}, ],
|
|
||||||
|
|
||||||
},
|
|
||||||
dict: {},
|
|
||||||
show: {},
|
|
||||||
currentCityArr: [],
|
|
||||||
originalDept: [],
|
|
||||||
currentCity: '请选择',
|
|
||||||
bysj: '',
|
|
||||||
loading: false,
|
|
||||||
route: {},
|
|
||||||
canChoosePerson: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onReady() {
|
|
||||||
this.$refs.uForm.setRules(this.rules)
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.loading = true;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancelPage() {
|
|
||||||
if (this.formData.id) {
|
|
||||||
this.edit = false;
|
|
||||||
this.getDetail(this.formData.id)
|
|
||||||
} else {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openPersonChooser() {
|
|
||||||
if (this.edit && this.canChoosePerson) {
|
|
||||||
this.$refs.personChooser.open();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
personNameConfirm(event) {
|
|
||||||
this.formData.personName = event.name
|
|
||||||
this.formData.personId = event.id
|
|
||||||
this.formData.userId = event.userId
|
|
||||||
this.formNameChange();
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
changeFile(e) {
|
|
||||||
// 清空当前的 fileUrl 数组
|
|
||||||
this.formData.fileUrl = [];
|
|
||||||
// 如果 e 有长度(即用户选择了文件)
|
|
||||||
if (e.length) {
|
|
||||||
// 遍历每个文件对象并获取其 url
|
|
||||||
for (let data of e) {
|
|
||||||
const url = data.data ? data.data.url : data.url;
|
|
||||||
this.formData.fileUrl.push(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
|
|
||||||
},
|
|
||||||
addOne() {
|
|
||||||
this.formData = {}
|
|
||||||
this.getPersonInfo()
|
|
||||||
if(this.name){
|
|
||||||
this.formData.personName = this.name
|
|
||||||
this.formData.userId = this.needid
|
|
||||||
}
|
|
||||||
this.edit = true
|
|
||||||
},
|
|
||||||
getDetail(id) {
|
|
||||||
getAssistService(id).then(res => {
|
|
||||||
this.formData = res.data;
|
|
||||||
this.edit = false
|
|
||||||
this.fileList = this.$processFileUrl(this.formData.fileUrl)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
confirmDate(type, e) {
|
|
||||||
this.show[type] = false;
|
|
||||||
let date = new Date(e.value)
|
|
||||||
this.formData[type] =
|
|
||||||
`${date.getFullYear()}-${(date.getMonth()+1)>9?(date.getMonth()+1):('0'+(date.getMonth()+1))}-${date.getDate()>9?date.getDate():('0'+date.getDate())}`
|
|
||||||
console.log(this.show[type], type)
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.navigateBack();
|
|
||||||
},
|
|
||||||
cancelPicker(type) {
|
|
||||||
this.show[type] = false
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
getDictLabel(value, list) {
|
|
||||||
if (list) {
|
|
||||||
let arr = list.filter(ele => ele.dictValue == value)
|
|
||||||
if (arr.length) {
|
|
||||||
return arr[0].dictLabel
|
|
||||||
} else {
|
|
||||||
return '请选择'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerConfirm(type, event) {
|
|
||||||
this.show[type] = false
|
|
||||||
this.formData[type] = event.value[0].dictValue
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
showPicker(type) {
|
|
||||||
if (this.edit) {
|
|
||||||
this.show[type] = true
|
|
||||||
this.$forceUpdate()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getPersonInfo() {
|
|
||||||
this.loading = true;
|
|
||||||
this.$store.dispatch("GetInfo").then((res) => {
|
|
||||||
if (res.data.roles.indexOf('qunzhong') == -1) {
|
|
||||||
this.canChoosePerson = true;
|
|
||||||
} else {
|
|
||||||
this.canChoosePerson = false;
|
|
||||||
getPersonBase(res.data.user.userId).then(resp => {
|
|
||||||
this.formData.personId = resp.data.id
|
|
||||||
this.formData.userId = resp.data.userId
|
|
||||||
this.formData.personName = resp.data.name
|
|
||||||
this.formNameChange();
|
|
||||||
this.$forceUpdate();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formNameChange() {
|
|
||||||
let date = new Date()
|
|
||||||
// let day =
|
|
||||||
// `${date.getFullYear()}-${(date.getMonth()+1) + 1 > 9 ? (date.getMonth()+1) + 1: '0'+((date.getMonth()+1) + 1)}-${date.getDate() > 9 ? date.getDate(): '0'+date.getDate()}`
|
|
||||||
const dayNew = dayjs(date).format("YYYY-MM-DD");
|
|
||||||
this.formData.demandTitle = `${this.formData.personName}_于${dayNew}_提出援助需求`
|
|
||||||
},
|
|
||||||
|
|
||||||
async saveInfo() {
|
|
||||||
try {
|
|
||||||
// 验证表单
|
|
||||||
const isValid = await this.$refs.uForm.validate();
|
|
||||||
console.log(isValid)
|
|
||||||
if (!isValid) {
|
|
||||||
throw new Error('请检查必填项填写');
|
|
||||||
}
|
|
||||||
// 显示全局加载
|
|
||||||
this.$showLoading();
|
|
||||||
// 根据 formData 是否有 id 来决定是更新还是新增
|
|
||||||
let response;
|
|
||||||
let successMessage;
|
|
||||||
if (this.formData.id) {
|
|
||||||
response = await updateAssistService(this.formData);
|
|
||||||
successMessage = '修改成功';
|
|
||||||
} else {
|
|
||||||
response = await addAssistService(this.formData);
|
|
||||||
successMessage = '保存成功';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查响应码是否为200
|
|
||||||
if (response.code === 200) {
|
|
||||||
this.$u.toast(successMessage);
|
|
||||||
// 如果是编辑模式,关闭编辑状态;否则返回上一页
|
|
||||||
if (this.formData.id) {
|
|
||||||
this.edit = false;
|
|
||||||
} else {
|
|
||||||
await this.$delay(1000); // 延迟1秒后返回上一页
|
|
||||||
uni.navigateBack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
if(error.length){
|
|
||||||
this.$u.toast('请填写完整信息!');
|
|
||||||
}else{
|
|
||||||
this.$u.toast('系统错误,请联系管理员!');
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// 确保加载页总是会被隐藏
|
|
||||||
this.$hideLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// saveInfo() {
|
|
||||||
// this.$refs.uForm.validate().then(res => {
|
|
||||||
// if (this.formData.id) {
|
|
||||||
// updateAssistService(this.formData).then(res => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '修改成功'
|
|
||||||
// })
|
|
||||||
// this.edit = false;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// addAssistService(this.formData).then(res => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '保存成功'
|
|
||||||
// })
|
|
||||||
// uni.navigateBack();
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }).catch(() => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '请检查必填项填写',
|
|
||||||
// icon: 'none'
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
|
|
||||||
.page ::v-deep .u-navbar__content {
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
|
||||||
background-color: #EEF1F5 !important;
|
|
||||||
height: 100vh;
|
|
||||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100% auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-area {
|
|
||||||
padding: 24rpx 32rpx 68rpx;
|
|
||||||
width: calc(100% + 64rpx);
|
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
border-radius: 16px 16px 0px 0px;
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
line-height: 72rpx;
|
|
||||||
width: 176rpx;
|
|
||||||
margin-right: 16rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
border: 1px solid #B8C5D4;
|
|
||||||
color: #282828;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
background: #DCE2E9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.save {
|
|
||||||
background: linear-gradient(103deg, #1D64CF 0%, #1590D4 99%);
|
|
||||||
color: #fff;
|
|
||||||
border: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.noValue {
|
|
||||||
color: rgb(192, 196, 204);
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabledLine {
|
|
||||||
background: rgb(245, 247, 250);
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2024-10-08 14:29:36
|
* @Date: 2024-10-08 14:29:36
|
||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-11-03 12:15:15
|
* @LastEditTime: 2025-11-03 15:43:51
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="container" style="background-color: #eef1f5;">
|
<view class="container">
|
||||||
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
|
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
|
||||||
<view class="inner">
|
<view class="inner">
|
||||||
<view class="part-title" style="display: flex;justify-content: space-between;">创业需求信息
|
<view class="part-title" style="display: flex;justify-content: space-between;">创业需求信息
|
||||||
@@ -463,7 +463,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
background: #eef1f5;
|
background: #fff;
|
||||||
|
width: calc(100% - 64rpx);
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0 auto;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
@@ -486,7 +489,7 @@
|
|||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 24rpx;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
@@ -594,8 +597,7 @@
|
|||||||
}
|
}
|
||||||
.button-area {
|
.button-area {
|
||||||
padding: 24rpx 32rpx 68rpx;
|
padding: 24rpx 32rpx 68rpx;
|
||||||
width: calc(100% + 64rpx);
|
width: 100%;
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2024-10-08 14:29:36
|
* @Date: 2024-10-08 14:29:36
|
||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-11-03 12:15:48
|
* @LastEditTime: 2025-11-03 16:11:03
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="container" style="background-color: #f7f7f7;">
|
<view class="container">
|
||||||
<scroll-view scroll-y="true" >
|
<scroll-view scroll-y="true" >
|
||||||
<view class="inner">
|
<view class="inner">
|
||||||
<view class="part-title" style="display: flex;justify-content: space-between;">求职需求信息
|
<view class="part-title" style="display: flex;justify-content: space-between;">求职需求信息
|
||||||
@@ -302,9 +302,11 @@
|
|||||||
},
|
},
|
||||||
// 移除uView表单验证相关代码
|
// 移除uView表单验证相关代码
|
||||||
created() {
|
created() {
|
||||||
getDicts('qcjy_fwnr').then(res => {
|
this.workTypeRemoteMethod('');
|
||||||
|
console.log('qcjy_fwnr' );
|
||||||
|
this.$getDict('qcjy_fwnr').then(res => {
|
||||||
this.bfnrzd = res.data;
|
this.bfnrzd = res.data;
|
||||||
});
|
});
|
||||||
this.setName()
|
this.setName()
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let arr = [{
|
let arr = [{
|
||||||
@@ -354,18 +356,14 @@
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.workTypeRemoteMethod('');
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
getDicts(dictType) {
|
getDicts(dictType) {
|
||||||
return new Promise((resolve, reject) => {
|
return this.$getDict(dictType)
|
||||||
// 这里应该调用实际的API,暂时返回空数组
|
// .then(res => {
|
||||||
// 如果需要真实的API调用,请替换下面的代码
|
// this.dict[dictType] = res.data;
|
||||||
setTimeout(() => {
|
// });
|
||||||
resolve({ data: [] });
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelPage() {
|
cancelPage() {
|
||||||
@@ -607,14 +605,6 @@
|
|||||||
this.$set(this.formData, "longitude", marker.location.lng);
|
this.$set(this.formData, "longitude", marker.location.lng);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 处理树形数据为级联选择器格式
|
// 处理树形数据为级联选择器格式
|
||||||
processWorkTypeTree(treeData) {
|
processWorkTypeTree(treeData) {
|
||||||
if (!treeData || !Array.isArray(treeData)) {
|
if (!treeData || !Array.isArray(treeData)) {
|
||||||
@@ -752,20 +742,11 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
||||||
.page ::v-deep .u-navbar__content {
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
|
||||||
background-color: #3161c7;
|
|
||||||
height: 100vh;
|
|
||||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100% auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
background: #eef1f5;
|
background: #fff;
|
||||||
|
width: calc(100% - 64rpx);
|
||||||
|
margin: 0 auto;
|
||||||
|
box-sizing: border-box;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
@@ -788,7 +769,7 @@
|
|||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 24rpx;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
@@ -868,8 +849,7 @@
|
|||||||
/* 按钮区域样式 */
|
/* 按钮区域样式 */
|
||||||
.button-area {
|
.button-area {
|
||||||
padding: 24rpx 32rpx 68rpx;
|
padding: 24rpx 32rpx 68rpx;
|
||||||
width: calc(100% + 64rpx);
|
width: 100%;
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2024-10-08 14:29:36
|
* @Date: 2024-10-08 14:29:36
|
||||||
* @LastEditors: lip
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-05-07 10:03:20
|
* @LastEditTime: 2025-11-03 16:07:40
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
@@ -229,7 +229,8 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss"> .container {
|
<style lang="scss">
|
||||||
|
.container {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
@@ -237,6 +238,9 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
|
|||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
width: calc(100% - 64rpx);
|
||||||
|
margin: 0 auto;
|
||||||
|
box-sizing: border-box;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
@@ -256,7 +260,7 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
|
|||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 24rpx;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
@@ -300,8 +304,7 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
|
|||||||
|
|
||||||
.button-area {
|
.button-area {
|
||||||
padding: 24rpx 32rpx 68rpx;
|
padding: 24rpx 32rpx 68rpx;
|
||||||
width: calc(100% + 64rpx);
|
width: 100%;
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2024-10-08 14:29:36
|
* @Date: 2024-10-08 14:29:36
|
||||||
* @LastEditors: lip
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-05-07 09:33:39
|
* @LastEditTime: 2025-11-03 16:07:22
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)', backgroundColor: '#eef1f5'}">
|
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
|
||||||
|
|
||||||
<view class="inner">
|
<view class="inner">
|
||||||
<view class="part-title" style="display: flex;justify-content: space-between;">培训需求信息
|
<view class="part-title" style="display: flex;justify-content: space-between;">培训需求信息
|
||||||
@@ -559,42 +559,12 @@ import uniDateformat from '@/uni_modules/uni-dateformat/components/uni-dateforma
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.date-picker-wrapper {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.date-picker-wrapper.noValue {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.date-value {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.page ::v-deep .u-navbar__content {
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
height: 100vh;
|
|
||||||
overflow: hidden;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
|
||||||
background-color: #3161c7;
|
|
||||||
height: 100vh;
|
|
||||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100% auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
background: #eef1f5;
|
background: #fff;
|
||||||
|
width: calc(100% - 64rpx);
|
||||||
|
margin: 0 auto;
|
||||||
|
box-sizing: border-box;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
@@ -615,7 +585,7 @@ import uniDateformat from '@/uni_modules/uni-dateformat/components/uni-dateforma
|
|||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 24rpx;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
@@ -733,8 +703,7 @@ import uniDateformat from '@/uni_modules/uni-dateformat/components/uni-dateforma
|
|||||||
|
|
||||||
.button-area {
|
.button-area {
|
||||||
padding: 24rpx 32rpx 68rpx;
|
padding: 24rpx 32rpx 68rpx;
|
||||||
width: calc(100% + 64rpx);
|
width: 100%;
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
export default {
|
|
||||||
props: {
|
|
||||||
// 内置图标名称,或图片路径,建议绝对路径
|
|
||||||
icon: {
|
|
||||||
type: String,
|
|
||||||
default: uni.$u.props.empty.icon
|
|
||||||
},
|
|
||||||
// 提示文字
|
|
||||||
text: {
|
|
||||||
type: String,
|
|
||||||
default: uni.$u.props.empty.text
|
|
||||||
},
|
|
||||||
// 文字颜色
|
|
||||||
textColor: {
|
|
||||||
type: String,
|
|
||||||
default: uni.$u.props.empty.textColor
|
|
||||||
},
|
|
||||||
// 文字大小
|
|
||||||
textSize: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: uni.$u.props.empty.textSize
|
|
||||||
},
|
|
||||||
// 图标的颜色
|
|
||||||
iconColor: {
|
|
||||||
type: String,
|
|
||||||
default: uni.$u.props.empty.iconColor
|
|
||||||
},
|
|
||||||
// 图标的大小
|
|
||||||
iconSize: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: uni.$u.props.empty.iconSize
|
|
||||||
},
|
|
||||||
// 选择预置的图标类型
|
|
||||||
mode: {
|
|
||||||
type: String,
|
|
||||||
default: uni.$u.props.empty.mode
|
|
||||||
},
|
|
||||||
// 图标宽度,单位px
|
|
||||||
width: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: uni.$u.props.empty.width
|
|
||||||
},
|
|
||||||
// 图标高度,单位px
|
|
||||||
height: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: uni.$u.props.empty.height
|
|
||||||
},
|
|
||||||
// 是否显示组件
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: uni.$u.props.empty.show
|
|
||||||
},
|
|
||||||
// 组件距离上一个元素之间的距离,默认px单位
|
|
||||||
marginTop: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: uni.$u.props.empty.marginTop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view
|
|
||||||
class="u-empty"
|
|
||||||
:style="[emptyStyle]"
|
|
||||||
v-if="show"
|
|
||||||
>
|
|
||||||
<u-icon
|
|
||||||
v-if="!isSrc"
|
|
||||||
:name="mode === 'message' ? 'chat' : `empty-${mode}`"
|
|
||||||
:size="iconSize"
|
|
||||||
:color="iconColor"
|
|
||||||
margin-top="14"
|
|
||||||
></u-icon>
|
|
||||||
<image
|
|
||||||
v-else
|
|
||||||
:style="{
|
|
||||||
width: $u.addUnit(width),
|
|
||||||
height: $u.addUnit(height),
|
|
||||||
}"
|
|
||||||
:src="icon"
|
|
||||||
mode="widthFix"
|
|
||||||
></image>
|
|
||||||
<text
|
|
||||||
class="u-empty__text"
|
|
||||||
:style="[textStyle]"
|
|
||||||
>{{text ? text : icons[mode]}}</text>
|
|
||||||
<view class="u-empty__wrap" v-if="$slots.default || $slots.$default">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import props from './props.js';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* empty 内容为空
|
|
||||||
* @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。
|
|
||||||
* @tutorial https://www.uviewui.com/components/empty.html
|
|
||||||
* @property {String} icon 内置图标名称,或图片路径,建议绝对路径
|
|
||||||
* @property {String} text 提示文字
|
|
||||||
* @property {String} textColor 文字颜色 (默认 '#c0c4cc' )
|
|
||||||
* @property {String | Number} textSize 文字大小 (默认 14 )
|
|
||||||
* @property {String} iconColor 图标的颜色 (默认 '#c0c4cc' )
|
|
||||||
* @property {String | Number} iconSize 图标的大小 (默认 90 )
|
|
||||||
* @property {String} mode 选择预置的图标类型 (默认 'data' )
|
|
||||||
* @property {String | Number} width 图标宽度,单位px (默认 160 )
|
|
||||||
* @property {String | Number} height 图标高度,单位px (默认 160 )
|
|
||||||
* @property {Boolean} show 是否显示组件 (默认 true )
|
|
||||||
* @property {String | Number} marginTop 组件距离上一个元素之间的距离,默认px单位 (默认 0 )
|
|
||||||
* @property {Object} customStyle 定义需要用到的外部样式
|
|
||||||
*
|
|
||||||
* @event {Function} click 点击组件时触发
|
|
||||||
* @event {Function} close 点击关闭按钮时触发
|
|
||||||
* @example <u-empty text="所谓伊人,在水一方" mode="list"></u-empty>
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: "u-empty",
|
|
||||||
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
icons: {
|
|
||||||
car: '购物车为空',
|
|
||||||
page: '页面不存在',
|
|
||||||
search: '没有搜索结果',
|
|
||||||
address: '没有收货地址',
|
|
||||||
wifi: '没有WiFi',
|
|
||||||
order: '订单为空',
|
|
||||||
coupon: '没有优惠券',
|
|
||||||
favor: '暂无收藏',
|
|
||||||
permission: '无权限',
|
|
||||||
history: '无历史记录',
|
|
||||||
news: '无新闻列表',
|
|
||||||
message: '消息列表为空',
|
|
||||||
list: '列表为空',
|
|
||||||
data: '数据为空',
|
|
||||||
comment: '暂无评论',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 组件样式
|
|
||||||
emptyStyle() {
|
|
||||||
const style = {}
|
|
||||||
style.marginTop = uni.$u.addUnit(this.marginTop)
|
|
||||||
// 合并customStyle样式,此参数通过mixin中的props传递
|
|
||||||
return uni.$u.deepMerge(uni.$u.addStyle(this.customStyle), style)
|
|
||||||
},
|
|
||||||
// 文本样式
|
|
||||||
textStyle() {
|
|
||||||
const style = {}
|
|
||||||
style.color = this.textColor
|
|
||||||
style.fontSize = uni.$u.addUnit(this.textSize)
|
|
||||||
return style
|
|
||||||
},
|
|
||||||
// 判断icon是否图片路径
|
|
||||||
isSrc() {
|
|
||||||
return this.icon.indexOf('/') >= 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import '@/uni_modules/uview-ui/libs/css/components.scss';
|
|
||||||
$u-empty-text-margin-top:20rpx !default;
|
|
||||||
$u-empty-slot-margin-top:20rpx !default;
|
|
||||||
|
|
||||||
.u-empty {
|
|
||||||
@include flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&__text {
|
|
||||||
@include flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: $u-empty-text-margin-top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.u-slot-wrap {
|
|
||||||
@include flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
margin-top:$u-empty-slot-margin-top;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2024-10-08 14:29:36
|
* @Date: 2024-10-08 14:29:36
|
||||||
* @LastEditors: lip
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-05-06 15:18:11
|
* @LastEditTime: 2025-11-03 16:29:26
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
|
||||||
<view class="page-header df_flex" style="display:flex;align-items:center;justify-content:space-between;padding:20rpx 0rpx;">
|
<view class="page-header df_flex" style="display:flex;align-items:center;justify-content:space-between;padding:20rpx 0rpx;">
|
||||||
<u-icon class="back-icon" name="arrow-left" color="#fff" size="16" @click="goBack()"></u-icon>
|
<u-icon class="back-icon" name="arrow-left" color="#fff" size="16" @click="goBack()"></u-icon>
|
||||||
<view class="title df_flex_1" style="padding-left: 32rpx;" >{{isAdd ? '需求新增' : '需求维护'}}</view>
|
<view class="title df_flex_1" style="padding-left: 32rpx;" >{{isAdd ? '需求新增' : '需求维护'}}</view>
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<jobService v-if="activeType == 1" :needId="id" :name="name" ref="type1" />
|
<jobService v-if="activeType == 1" :needId="id" :name="name" ref="type1" />
|
||||||
<assistService v-if="activeType == 2" :needId="id" :name="name" ref="type2" />
|
|
||||||
<entrepreneurshipService :needId="id" :name="name" v-if="activeType == 3" ref="type3" />
|
<entrepreneurshipService :needId="id" :name="name" v-if="activeType == 3" ref="type3" />
|
||||||
<trainService v-if="activeType == 4" :needId="id" :name="name" ref="type4" />
|
<trainService v-if="activeType == 4" :needId="id" :name="name" ref="type4" />
|
||||||
<otherService v-if="activeType == 5" :needId="id" :name="name" ref="type5" />
|
<otherService v-if="activeType == 5" :needId="id" :name="name" ref="type5" />
|
||||||
@@ -32,14 +31,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import jobService from './components/jobService.vue';
|
import jobService from './components/jobService.vue';
|
||||||
import assistService from './components/assistService.vue';
|
|
||||||
import entrepreneurshipService from './components/entrepreneurshipService.vue';
|
import entrepreneurshipService from './components/entrepreneurshipService.vue';
|
||||||
import trainService from './components/trainService.vue';
|
import trainService from './components/trainService.vue';
|
||||||
import otherService from './components/otherService.vue';
|
import otherService from './components/otherService.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
jobService,
|
jobService,
|
||||||
assistService,
|
|
||||||
entrepreneurshipService,
|
entrepreneurshipService,
|
||||||
trainService,
|
trainService,
|
||||||
otherService,
|
otherService,
|
||||||
@@ -87,14 +84,10 @@
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
||||||
.page ::v-deep .u-navbar__content {
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
background-color: #EEF1F5 !important;
|
background-color: #F4F4F4 !important;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% auto;
|
background-size: 100% auto;
|
||||||
|
|
||||||
@@ -102,8 +95,7 @@
|
|||||||
|
|
||||||
.button-area {
|
.button-area {
|
||||||
padding: 24rpx 32rpx 68rpx;
|
padding: 24rpx 32rpx 68rpx;
|
||||||
width: calc(100% + 64rpx);
|
width: 100%;
|
||||||
margin-left: -32rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
BIN
packageRc/static/images/serviceFrequency.png
Normal file
BIN
packageRc/static/images/serviceFrequency.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
14
pages.json
14
pages.json
@@ -432,32 +432,24 @@
|
|||||||
"path": "pages/daiban/daiban",
|
"path": "pages/daiban/daiban",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "待办任务"
|
"navigationBarTitleText": "待办任务"
|
||||||
// "navigationBarBackgroundColor": "#4778EC",
|
|
||||||
// "navigationBarTextStyle": "white"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/daiban/daibandetail",
|
"path": "pages/daiban/daibandetail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "待办详情",
|
"navigationBarTitleText": "待办详情"
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "pages/demand/demandail",
|
"path": "pages/demand/demandail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "新增需求",
|
"navigationBarTitleText": "新增需求"
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
}
|
||||||
} , {
|
} , {
|
||||||
"path": "pages/daiban/addbangfu",
|
"path": "pages/daiban/addbangfu",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "添加帮扶",
|
"navigationBarTitleText": "添加帮扶"
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
58
uni_modules/uni-swipe-action/changelog.md
Normal file
58
uni_modules/uni-swipe-action/changelog.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
## 1.3.16(2025-06-11)
|
||||||
|
- 修复 鸿蒙 next 浏览器上无法滑动的问题
|
||||||
|
## 1.3.14(2025-06-09)
|
||||||
|
- 优化 更新示例项目
|
||||||
|
## 1.3.13(2025-04-15)
|
||||||
|
- 修复 app 端 缺少leftOptions 或 rightOptions 时无法滑动的问题
|
||||||
|
## 1.3.12(2025-04-14)
|
||||||
|
- 修复 由上一个兼容版本引发的 安卓运行报错且无法回弹的问题
|
||||||
|
## 1.3.11(2025-04-08)
|
||||||
|
- 优化 兼容鸿蒙平台
|
||||||
|
- 修复 WEB 平台控制台报错
|
||||||
|
## 1.3.10(2024-01-17)
|
||||||
|
- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug(兼容阿里/百度/抖音小程序)
|
||||||
|
## 1.3.9(2024-01-17)
|
||||||
|
- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug
|
||||||
|
## 1.3.8(2023-04-13)
|
||||||
|
- 修复`uni-swipe-action`和`uni-swipe-action-item`不同时使用导致 closeOther 方法报错的 bug
|
||||||
|
## 1.3.7(2022-06-06)
|
||||||
|
- 修复 vue3 下使用组件不能正常运行的Bug
|
||||||
|
## 1.3.6(2022-05-31)
|
||||||
|
- 修复 h5端点击click触发两次的Bug
|
||||||
|
## 1.3.5(2022-05-23)
|
||||||
|
- 修复 isPC 找不到的Bug
|
||||||
|
## 1.3.4(2022-05-19)
|
||||||
|
- 修复 在 nvue 下 disabled 失效的bug
|
||||||
|
## 1.3.3(2022-03-31)
|
||||||
|
- 修复 按钮字体大小不能设置的bug
|
||||||
|
## 1.3.2(2022-03-16)
|
||||||
|
- 修复 h5和app端下报el错误的bug
|
||||||
|
## 1.3.1(2022-03-07)
|
||||||
|
- 修复 HBuilderX 1.4.X 版本中,h5和app端下报错的bug
|
||||||
|
## 1.3.0(2021-11-19)
|
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-swipe-action](https://uniapp.dcloud.io/component/uniui/uni-swipe-action)
|
||||||
|
## 1.2.4(2021-08-20)
|
||||||
|
- 优化 close-all 方法
|
||||||
|
## 1.2.3(2021-08-20)
|
||||||
|
- 新增 close-all 方法,关闭所有已打开的组件
|
||||||
|
## 1.2.2(2021-08-17)
|
||||||
|
- 新增 resize() 方法,在非微信小程序、h5、app-vue端出现不能滑动的问题的时候,重置组件
|
||||||
|
- 修复 app 端偶尔出现类似 Page[x][-x,xx;-x,xx,x,x-x] 的问题
|
||||||
|
- 优化 微信小程序、h5、app-vue 滑动逻辑,避免出现动态新增组件后不能滑动的问题
|
||||||
|
## 1.2.1(2021-07-30)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
- 修复 跨页面修改组件数据 ,导致不能滑动的问题
|
||||||
|
## 1.1.10(2021-06-17)
|
||||||
|
- 修复 按钮点击执行两次的bug
|
||||||
|
## 1.1.9(2021-05-12)
|
||||||
|
- 新增 项目示例地址
|
||||||
|
## 1.1.8(2021-03-26)
|
||||||
|
- 修复 微信小程序 nv_navigator is not defined 报错的bug
|
||||||
|
## 1.1.7(2021-02-05)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
|
- 新增 左侧滑动
|
||||||
|
- 新增 插槽使用方式
|
||||||
|
- 新增 threshold 属性,可以控制滑动缺省值
|
||||||
|
- 优化 长列表滚动性能
|
||||||
|
- 修复 滚动页面时触发组件滑动的Bug
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
let bindIngXMixins = {}
|
||||||
|
|
||||||
|
// #ifdef APP-NVUE
|
||||||
|
const BindingX = uni.requireNativePlugin('bindingx');
|
||||||
|
const dom = uni.requireNativePlugin('dom');
|
||||||
|
const animation = uni.requireNativePlugin('animation');
|
||||||
|
|
||||||
|
bindIngXMixins = {
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
show(newVal) {
|
||||||
|
if (this.autoClose) return
|
||||||
|
if (this.stop) return
|
||||||
|
this.stop = true
|
||||||
|
if (newVal) {
|
||||||
|
this.open(newVal)
|
||||||
|
} else {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
leftOptions() {
|
||||||
|
this.getSelectorQuery()
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
rightOptions(newVal) {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.swipeaction = this.getSwipeAction()
|
||||||
|
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
||||||
|
this.swipeaction.children.push(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.box = this.getEl(this.$refs['selector-box--hock'])
|
||||||
|
this.selector = this.getEl(this.$refs['selector-content--hock']);
|
||||||
|
this.leftButton = this.getEl(this.$refs['selector-left-button--hock']);
|
||||||
|
this.rightButton = this.getEl(this.$refs['selector-right-button--hock']);
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
// beforeDestroy() {
|
||||||
|
// this.swipeaction.children.forEach((item, index) => {
|
||||||
|
// if (item === this) {
|
||||||
|
// this.swipeaction.children.splice(index, 1)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.x = 0
|
||||||
|
this.button = {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getSelectorQuery()
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClick(index, item, position) {
|
||||||
|
this.$emit('click', {
|
||||||
|
content: item,
|
||||||
|
index,
|
||||||
|
position
|
||||||
|
})
|
||||||
|
},
|
||||||
|
touchstart(e) {
|
||||||
|
// fix by mehaotian 禁止滑动
|
||||||
|
if (this.disabled) return
|
||||||
|
// 每次只触发一次,避免多次监听造成闪烁
|
||||||
|
if (this.stop) return
|
||||||
|
this.stop = true
|
||||||
|
if (this.autoClose && this.swipeaction) {
|
||||||
|
this.swipeaction.closeOther(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
const leftWidth = this.button.left.width
|
||||||
|
const rightWidth = this.button.right.width
|
||||||
|
let expression = this.range(this.x, -rightWidth, leftWidth)
|
||||||
|
let leftExpression = this.range(this.x - leftWidth, -leftWidth, 0)
|
||||||
|
let rightExpression = this.range(this.x + rightWidth, 0, rightWidth)
|
||||||
|
|
||||||
|
this.eventpan = BindingX.bind({
|
||||||
|
anchor: this.box,
|
||||||
|
eventType: 'pan',
|
||||||
|
props: [{
|
||||||
|
element: this.selector,
|
||||||
|
property: 'transform.translateX',
|
||||||
|
expression
|
||||||
|
}, {
|
||||||
|
element: this.leftButton,
|
||||||
|
property: 'transform.translateX',
|
||||||
|
expression: leftExpression
|
||||||
|
}, {
|
||||||
|
element: this.rightButton,
|
||||||
|
property: 'transform.translateX',
|
||||||
|
expression: rightExpression
|
||||||
|
}, ]
|
||||||
|
}, (e) => {
|
||||||
|
// nope
|
||||||
|
if (e.state === 'end') {
|
||||||
|
this.x = e.deltaX + this.x;
|
||||||
|
this.isclick = true
|
||||||
|
this.bindTiming(e.deltaX)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
touchend(e) {
|
||||||
|
if (this.isopen !== 'none' && !this.isclick) {
|
||||||
|
this.open('none')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bindTiming(x) {
|
||||||
|
const left = this.x
|
||||||
|
const leftWidth = this.button.left.width
|
||||||
|
const rightWidth = this.button.right.width
|
||||||
|
const threshold = this.threshold
|
||||||
|
if (!this.isopen || this.isopen === 'none') {
|
||||||
|
if (left > threshold) {
|
||||||
|
this.open('left')
|
||||||
|
} else if (left < -threshold) {
|
||||||
|
this.open('right')
|
||||||
|
} else {
|
||||||
|
this.open('none')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((x > -leftWidth && x < 0) || x > rightWidth) {
|
||||||
|
if ((x > -threshold && x < 0) || (x - rightWidth > threshold)) {
|
||||||
|
this.open('left')
|
||||||
|
} else {
|
||||||
|
this.open('none')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) {
|
||||||
|
this.open('right')
|
||||||
|
} else {
|
||||||
|
this.open('none')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动范围
|
||||||
|
* @param {Object} num
|
||||||
|
* @param {Object} mix
|
||||||
|
* @param {Object} max
|
||||||
|
*/
|
||||||
|
range(num, mix, max) {
|
||||||
|
return `min(max(x+${num}, ${mix}), ${max})`
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启swipe
|
||||||
|
*/
|
||||||
|
open(type) {
|
||||||
|
this.animation(type)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭swipe
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
this.animation('none')
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启关闭动画
|
||||||
|
* @param {Object} type
|
||||||
|
*/
|
||||||
|
animation(type) {
|
||||||
|
const time = 300
|
||||||
|
const leftWidth = this.button.left.width
|
||||||
|
const rightWidth = this.button.right.width
|
||||||
|
if (this.eventpan && this.eventpan.token) {
|
||||||
|
BindingX.unbind({
|
||||||
|
token: this.eventpan.token,
|
||||||
|
eventType: 'pan'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 'left':
|
||||||
|
Promise.all([
|
||||||
|
this.move(this.selector, leftWidth),
|
||||||
|
this.move(this.leftButton, 0),
|
||||||
|
this.move(this.rightButton, rightWidth * 2)
|
||||||
|
]).then(() => {
|
||||||
|
this.setEmit(leftWidth, type)
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 'right':
|
||||||
|
Promise.all([
|
||||||
|
this.move(this.selector, -rightWidth),
|
||||||
|
this.move(this.leftButton, -leftWidth * 2),
|
||||||
|
this.move(this.rightButton, 0)
|
||||||
|
]).then(() => {
|
||||||
|
this.setEmit(-rightWidth, type)
|
||||||
|
})
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
Promise.all([
|
||||||
|
this.move(this.selector, 0),
|
||||||
|
this.move(this.leftButton, -leftWidth),
|
||||||
|
this.move(this.rightButton, rightWidth)
|
||||||
|
]).then(() => {
|
||||||
|
this.setEmit(0, type)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setEmit(x, type) {
|
||||||
|
const leftWidth = this.button.left.width
|
||||||
|
const rightWidth = this.button.right.width
|
||||||
|
this.isopen = this.isopen || 'none'
|
||||||
|
this.stop = false
|
||||||
|
this.isclick = false
|
||||||
|
// 只有状态不一致才会返回结果
|
||||||
|
if (this.isopen !== type && this.x !== x) {
|
||||||
|
if (type === 'left' && leftWidth > 0) {
|
||||||
|
this.$emit('change', 'left')
|
||||||
|
}
|
||||||
|
if (type === 'right' && rightWidth > 0) {
|
||||||
|
this.$emit('change', 'right')
|
||||||
|
}
|
||||||
|
if (type === 'none') {
|
||||||
|
this.$emit('change', 'none')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.x = x
|
||||||
|
this.isopen = type
|
||||||
|
},
|
||||||
|
move(ref, value) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
animation.transition(ref, {
|
||||||
|
styles: {
|
||||||
|
transform: `translateX(${value})`,
|
||||||
|
},
|
||||||
|
duration: 150, //ms
|
||||||
|
timingFunction: 'linear',
|
||||||
|
needLayout: false,
|
||||||
|
delay: 0 //ms
|
||||||
|
}, function(res) {
|
||||||
|
resolve(res)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取ref
|
||||||
|
* @param {Object} el
|
||||||
|
*/
|
||||||
|
getEl(el) {
|
||||||
|
return el.ref
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取节点信息
|
||||||
|
*/
|
||||||
|
getSelectorQuery() {
|
||||||
|
Promise.all([
|
||||||
|
this.getDom('left'),
|
||||||
|
this.getDom('right'),
|
||||||
|
]).then((data) => {
|
||||||
|
let show = 'none'
|
||||||
|
if (this.autoClose) {
|
||||||
|
show = 'none'
|
||||||
|
} else {
|
||||||
|
show = this.show
|
||||||
|
}
|
||||||
|
|
||||||
|
if (show === 'none') {
|
||||||
|
// this.close()
|
||||||
|
} else {
|
||||||
|
this.open(show)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
getDom(str) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
|
||||||
|
if (data) {
|
||||||
|
this.button[str] = data.size
|
||||||
|
resolve(data)
|
||||||
|
} else {
|
||||||
|
reject()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
export default bindIngXMixins
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export function isPC() {
|
||||||
|
var userAgentInfo = navigator.userAgent;
|
||||||
|
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||||
|
var flag = true;
|
||||||
|
for (let v = 0; v < Agents.length - 1; v++) {
|
||||||
|
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
x: 0,
|
||||||
|
transition: false,
|
||||||
|
width: 0,
|
||||||
|
viewWidth: 0,
|
||||||
|
swipeShow: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show(newVal) {
|
||||||
|
if (this.autoClose) return
|
||||||
|
if (newVal && newVal !== 'none') {
|
||||||
|
this.transition = true
|
||||||
|
this.open(newVal)
|
||||||
|
} else {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.swipeaction = this.getSwipeAction()
|
||||||
|
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
||||||
|
this.swipeaction.children.push(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.isopen = false
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getQuerySelect()
|
||||||
|
}, 50)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
appTouchStart(e) {
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
this.clientX = clientX
|
||||||
|
this.timestamp = new Date().getTime()
|
||||||
|
},
|
||||||
|
appTouchEnd(e, index, item, position) {
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
// fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
|
||||||
|
let diff = Math.abs(this.clientX - clientX)
|
||||||
|
let time = (new Date().getTime()) - this.timestamp
|
||||||
|
if (diff < 40 && time < 300) {
|
||||||
|
this.$emit('click', {
|
||||||
|
content: item,
|
||||||
|
index,
|
||||||
|
position
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 移动触发
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
|
onChange(e) {
|
||||||
|
this.moveX = e.detail.x
|
||||||
|
this.isclose = false
|
||||||
|
},
|
||||||
|
touchstart(e) {
|
||||||
|
this.transition = false
|
||||||
|
this.isclose = true
|
||||||
|
if (this.autoClose && this.swipeaction) {
|
||||||
|
this.swipeaction.closeOther(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
touchmove(e) {},
|
||||||
|
touchend(e) {
|
||||||
|
// 0的位置什么都不执行
|
||||||
|
if (this.isclose && this.isopen === 'none') return
|
||||||
|
if (this.isclose && this.isopen !== 'none') {
|
||||||
|
this.transition = true
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.move(this.moveX + this.leftWidth)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动
|
||||||
|
* @param {Object} moveX
|
||||||
|
*/
|
||||||
|
move(moveX) {
|
||||||
|
// 打开关闭的处理逻辑不太一样
|
||||||
|
this.transition = true
|
||||||
|
// 未打开状态
|
||||||
|
if (!this.isopen || this.isopen === 'none') {
|
||||||
|
if (moveX > this.threshold) {
|
||||||
|
this.open('left')
|
||||||
|
} else if (moveX < -this.threshold) {
|
||||||
|
this.open('right')
|
||||||
|
} else {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (moveX < 0 && moveX < this.rightWidth) {
|
||||||
|
const rightX = this.rightWidth + moveX
|
||||||
|
if (rightX < this.threshold) {
|
||||||
|
this.open('right')
|
||||||
|
} else {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
} else if (moveX > 0 && moveX < this.leftWidth) {
|
||||||
|
const leftX = this.leftWidth - moveX
|
||||||
|
if (leftX < this.threshold) {
|
||||||
|
this.open('left')
|
||||||
|
} else {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开
|
||||||
|
*/
|
||||||
|
open(type) {
|
||||||
|
this.x = this.moveX
|
||||||
|
this.animation(type)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
this.x = this.moveX
|
||||||
|
// TODO 解决 x 值不更新的问题,所以会多触发一次 nextTick ,待优化
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.x = -this.leftWidth
|
||||||
|
if (this.isopen !== 'none') {
|
||||||
|
this.$emit('change', 'none')
|
||||||
|
}
|
||||||
|
this.isopen = 'none'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行结束动画
|
||||||
|
* @param {Object} type
|
||||||
|
*/
|
||||||
|
animation(type) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (type === 'left') {
|
||||||
|
this.x = 0
|
||||||
|
} else {
|
||||||
|
this.x = -this.rightWidth - this.leftWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isopen !== type) {
|
||||||
|
this.$emit('change', type)
|
||||||
|
}
|
||||||
|
this.isopen = type
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
getSlide(x) {},
|
||||||
|
getQuerySelect() {
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query.selectAll('.movable-view--hock').boundingClientRect(data => {
|
||||||
|
this.leftWidth = data[1].width
|
||||||
|
this.rightWidth = data[2].width
|
||||||
|
this.width = data[0].width
|
||||||
|
this.viewWidth = this.width + this.rightWidth + this.leftWidth
|
||||||
|
if (this.leftWidth === 0) {
|
||||||
|
// TODO 疑似bug ,初始化的时候如果x 是0,会导致移动位置错误,所以让元素超出一点
|
||||||
|
this.x = -0.1
|
||||||
|
} else {
|
||||||
|
this.x = -this.leftWidth
|
||||||
|
}
|
||||||
|
this.moveX = this.x
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.swipeShow = 1
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!this.buttonWidth) {
|
||||||
|
this.disabledView = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.autoClose) return
|
||||||
|
if (this.show !== 'none') {
|
||||||
|
this.transition = true
|
||||||
|
this.open(this.shows)
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,260 @@
|
|||||||
|
let otherMixins = {}
|
||||||
|
|
||||||
|
// #ifndef APP-PLUS|| MP-WEIXIN || H5
|
||||||
|
const MIN_DISTANCE = 10;
|
||||||
|
otherMixins = {
|
||||||
|
data() {
|
||||||
|
// TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
|
||||||
|
const elClass = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
||||||
|
return {
|
||||||
|
uniShow: false,
|
||||||
|
left: 0,
|
||||||
|
buttonShow: 'none',
|
||||||
|
ani: false,
|
||||||
|
moveLeft: '',
|
||||||
|
elClass
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show(newVal) {
|
||||||
|
if (this.autoClose) return
|
||||||
|
this.openState(newVal)
|
||||||
|
},
|
||||||
|
left() {
|
||||||
|
this.moveLeft = `translateX(${this.left}px)`
|
||||||
|
},
|
||||||
|
buttonShow(newVal) {
|
||||||
|
if (this.autoClose) return
|
||||||
|
this.openState(newVal)
|
||||||
|
},
|
||||||
|
leftOptions() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
rightOptions() {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.swipeaction = this.getSwipeAction()
|
||||||
|
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
||||||
|
this.swipeaction.children.push(this)
|
||||||
|
}
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.getSelectorQuery()
|
||||||
|
}, 100)
|
||||||
|
// 移动距离
|
||||||
|
this.left = 0
|
||||||
|
this.x = 0
|
||||||
|
},
|
||||||
|
|
||||||
|
closeSwipe(e) {
|
||||||
|
if (this.autoClose && this.swipeaction) {
|
||||||
|
this.swipeaction.closeOther(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
appTouchStart(e) {
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
this.clientX = clientX
|
||||||
|
this.timestamp = new Date().getTime()
|
||||||
|
},
|
||||||
|
appTouchEnd(e, index, item, position) {
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
// fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
|
||||||
|
let diff = Math.abs(this.clientX - clientX)
|
||||||
|
let time = (new Date().getTime()) - this.timestamp
|
||||||
|
if (diff < 40 && time < 300) {
|
||||||
|
this.$emit('click', {
|
||||||
|
content: item,
|
||||||
|
index,
|
||||||
|
position
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
touchstart(e) {
|
||||||
|
if (this.disabled) return
|
||||||
|
this.ani = false
|
||||||
|
this.x = this.left || 0
|
||||||
|
this.stopTouchStart(e)
|
||||||
|
this.autoClose && this.closeSwipe()
|
||||||
|
},
|
||||||
|
touchmove(e) {
|
||||||
|
if (this.disabled) return
|
||||||
|
// 是否可以滑动页面
|
||||||
|
this.stopTouchMove(e);
|
||||||
|
if (this.direction !== 'horizontal') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.move(this.x + this.deltaX)
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
touchend() {
|
||||||
|
if (this.disabled) return
|
||||||
|
this.moveDirection(this.left)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 设置移动距离
|
||||||
|
* @param {Object} value
|
||||||
|
*/
|
||||||
|
move(value) {
|
||||||
|
value = value || 0
|
||||||
|
const leftWidth = this.leftWidth
|
||||||
|
const rightWidth = this.rightWidth
|
||||||
|
// 获取可滑动范围
|
||||||
|
this.left = this.range(value, -rightWidth, leftWidth);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取范围
|
||||||
|
* @param {Object} num
|
||||||
|
* @param {Object} min
|
||||||
|
* @param {Object} max
|
||||||
|
*/
|
||||||
|
range(num, min, max) {
|
||||||
|
return Math.min(Math.max(num, min), max);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 移动方向判断
|
||||||
|
* @param {Object} left
|
||||||
|
* @param {Object} value
|
||||||
|
*/
|
||||||
|
moveDirection(left) {
|
||||||
|
const threshold = this.threshold
|
||||||
|
const isopen = this.isopen || 'none'
|
||||||
|
const leftWidth = this.leftWidth
|
||||||
|
const rightWidth = this.rightWidth
|
||||||
|
if (this.deltaX === 0) {
|
||||||
|
this.openState('none')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth >
|
||||||
|
0 && rightWidth +
|
||||||
|
left < threshold)) {
|
||||||
|
// right
|
||||||
|
this.openState('right')
|
||||||
|
} else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth >
|
||||||
|
0 &&
|
||||||
|
leftWidth - left < threshold)) {
|
||||||
|
// left
|
||||||
|
this.openState('left')
|
||||||
|
} else {
|
||||||
|
// default
|
||||||
|
this.openState('none')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启状态
|
||||||
|
* @param {Boolean} type
|
||||||
|
*/
|
||||||
|
openState(type) {
|
||||||
|
const leftWidth = this.leftWidth
|
||||||
|
const rightWidth = this.rightWidth
|
||||||
|
let left = ''
|
||||||
|
this.isopen = this.isopen ? this.isopen : 'none'
|
||||||
|
switch (type) {
|
||||||
|
case "left":
|
||||||
|
left = leftWidth
|
||||||
|
break
|
||||||
|
case "right":
|
||||||
|
left = -rightWidth
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
left = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (this.isopen !== type) {
|
||||||
|
this.throttle = true
|
||||||
|
this.$emit('change', type)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isopen = type
|
||||||
|
// 添加动画类
|
||||||
|
this.ani = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.move(left)
|
||||||
|
})
|
||||||
|
// 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.openState('none')
|
||||||
|
},
|
||||||
|
getDirection(x, y) {
|
||||||
|
if (x > y && x > MIN_DISTANCE) {
|
||||||
|
return 'horizontal';
|
||||||
|
}
|
||||||
|
if (y > x && y > MIN_DISTANCE) {
|
||||||
|
return 'vertical';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置滑动状态
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
resetTouchStatus() {
|
||||||
|
this.direction = '';
|
||||||
|
this.deltaX = 0;
|
||||||
|
this.deltaY = 0;
|
||||||
|
this.offsetX = 0;
|
||||||
|
this.offsetY = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置滑动开始位置
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
stopTouchStart(event) {
|
||||||
|
this.resetTouchStatus();
|
||||||
|
const touch = event.touches[0];
|
||||||
|
this.startX = touch.clientX;
|
||||||
|
this.startY = touch.clientY;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 滑动中,是否禁止打开
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
stopTouchMove(event) {
|
||||||
|
const touch = event.touches[0];
|
||||||
|
this.deltaX = touch.clientX - this.startX;
|
||||||
|
this.deltaY = touch.clientY - this.startY;
|
||||||
|
this.offsetX = Math.abs(this.deltaX);
|
||||||
|
this.offsetY = Math.abs(this.deltaY);
|
||||||
|
this.direction = this.direction || this.getDirection(this.offsetX, this.offsetY);
|
||||||
|
},
|
||||||
|
|
||||||
|
getSelectorQuery() {
|
||||||
|
const views = uni.createSelectorQuery().in(this)
|
||||||
|
views
|
||||||
|
.selectAll('.' + this.elClass)
|
||||||
|
.boundingClientRect(data => {
|
||||||
|
if (data.length === 0) return
|
||||||
|
let show = 'none'
|
||||||
|
if (this.autoClose) {
|
||||||
|
show = 'none'
|
||||||
|
} else {
|
||||||
|
show = this.show
|
||||||
|
}
|
||||||
|
this.leftWidth = data[0].width || 0
|
||||||
|
this.rightWidth = data[1].width || 0
|
||||||
|
this.buttonShow = show
|
||||||
|
})
|
||||||
|
.exec()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
export default otherMixins
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
let mpMixins = {}
|
||||||
|
let is_pc = null
|
||||||
|
// #ifdef H5
|
||||||
|
import {
|
||||||
|
isPC
|
||||||
|
} from "./isPC"
|
||||||
|
is_pc = isPC()
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-VUE || APP-HARMONY || MP-WEIXIN || H5
|
||||||
|
|
||||||
|
mpMixins = {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
is_show: 'none'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show(newVal) {
|
||||||
|
this.is_show = this.show
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.swipeaction = this.getSwipeAction()
|
||||||
|
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
||||||
|
this.swipeaction.children.push(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.is_show = this.show
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// wxs 中调用
|
||||||
|
closeSwipe(e) {
|
||||||
|
if (this.autoClose && this.swipeaction) {
|
||||||
|
this.swipeaction.closeOther(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
change(e) {
|
||||||
|
this.$emit('change', e.open)
|
||||||
|
if (this.is_show !== e.open) {
|
||||||
|
this.is_show = e.open
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
appTouchStart(e) {
|
||||||
|
if (is_pc) return
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
this.clientX = clientX
|
||||||
|
this.timestamp = new Date().getTime()
|
||||||
|
},
|
||||||
|
appTouchEnd(e, index, item, position) {
|
||||||
|
if (is_pc) return
|
||||||
|
const {
|
||||||
|
clientX
|
||||||
|
} = e.changedTouches[0]
|
||||||
|
// fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
|
||||||
|
let diff = Math.abs(this.clientX - clientX)
|
||||||
|
let time = (new Date().getTime()) - this.timestamp
|
||||||
|
if (diff < 40 && time < 300) {
|
||||||
|
this.$emit('click', {
|
||||||
|
content: item,
|
||||||
|
index,
|
||||||
|
position
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClickForPC(index, item, position) {
|
||||||
|
if (!is_pc) return
|
||||||
|
// #ifdef H5
|
||||||
|
this.$emit('click', {
|
||||||
|
content: item,
|
||||||
|
index,
|
||||||
|
position
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
export default mpMixins
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
const MIN_DISTANCE = 10;
|
||||||
|
export default {
|
||||||
|
showWatch(newVal, oldVal, ownerInstance, instance, self) {
|
||||||
|
var state = self.state || {}
|
||||||
|
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
||||||
|
if (!$el) return
|
||||||
|
this.getDom(instance, ownerInstance, self)
|
||||||
|
if (newVal && newVal !== 'none') {
|
||||||
|
this.openState(newVal, instance, ownerInstance, self)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.left) {
|
||||||
|
this.openState('none', instance, ownerInstance, self)
|
||||||
|
}
|
||||||
|
this.resetTouchStatus(instance, self)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始触摸操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ins
|
||||||
|
*/
|
||||||
|
touchstart(e, ownerInstance, self) {
|
||||||
|
let instance = e.instance;
|
||||||
|
let disabled = instance.getDataset().disabled
|
||||||
|
let state = self.state || {};
|
||||||
|
this.getDom(instance, ownerInstance, self)
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = this.getDisabledType(disabled)
|
||||||
|
if (disabled) return
|
||||||
|
// 开始触摸时移除动画类
|
||||||
|
instance.requestAnimationFrame(function() {
|
||||||
|
instance.removeClass('ani');
|
||||||
|
ownerInstance.callMethod('closeSwipe');
|
||||||
|
})
|
||||||
|
|
||||||
|
// 记录上次的位置
|
||||||
|
state.x = state.left || 0
|
||||||
|
// 计算滑动开始位置
|
||||||
|
this.stopTouchStart(e, ownerInstance, self)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始滑动操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
touchmove(e, ownerInstance, self) {
|
||||||
|
let instance = e.instance;
|
||||||
|
// 删除之后已经那不到实例了
|
||||||
|
if (!instance) return;
|
||||||
|
let disabled = instance.getDataset().disabled
|
||||||
|
let state = self.state || {}
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = this.getDisabledType(disabled)
|
||||||
|
if (disabled) return
|
||||||
|
// 是否可以滑动页面
|
||||||
|
this.stopTouchMove(e, self);
|
||||||
|
if (state.direction !== 'horizontal') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.preventDefault) {
|
||||||
|
// 阻止页面滚动
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
let x = state.x + state.deltaX
|
||||||
|
this.move(x, instance, ownerInstance, self)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束触摸操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
touchend(e, ownerInstance, self) {
|
||||||
|
let instance = e.instance;
|
||||||
|
let disabled = instance.getDataset().disabled
|
||||||
|
let state = self.state || {}
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = this.getDisabledType(disabled)
|
||||||
|
|
||||||
|
if (disabled) return
|
||||||
|
// 滑动过程中触摸结束,通过阙值判断是开启还是关闭
|
||||||
|
// fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
|
||||||
|
this.moveDirection(state.left, instance, ownerInstance, self)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置移动距离
|
||||||
|
* @param {Object} value
|
||||||
|
* @param {Object} instance
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
move(value, instance, ownerInstance, self) {
|
||||||
|
value = value || 0
|
||||||
|
let state = self.state || {}
|
||||||
|
let leftWidth = state.leftWidth
|
||||||
|
let rightWidth = state.rightWidth
|
||||||
|
// 获取可滑动范围
|
||||||
|
state.left = this.range(value, -rightWidth, leftWidth);
|
||||||
|
instance.requestAnimationFrame(function() {
|
||||||
|
instance.setStyle({
|
||||||
|
transform: 'translateX(' + state.left + 'px)',
|
||||||
|
'-webkit-transform': 'translateX(' + state.left + 'px)'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取元素信息
|
||||||
|
* @param {Object} instance
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
getDom(instance, ownerInstance, self) {
|
||||||
|
var state = self.state || {}
|
||||||
|
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
||||||
|
var leftDom = $el.querySelector('.button-group--left')
|
||||||
|
var rightDom = $el.querySelector('.button-group--right')
|
||||||
|
if (leftDom && leftDom.offsetWidth) {
|
||||||
|
state.leftWidth = leftDom.offsetWidth || 0
|
||||||
|
} else {
|
||||||
|
state.leftWidth = 0
|
||||||
|
}
|
||||||
|
if (rightDom && rightDom.offsetWidth) {
|
||||||
|
state.rightWidth = rightDom.offsetWidth || 0
|
||||||
|
} else {
|
||||||
|
state.rightWidth = 0
|
||||||
|
}
|
||||||
|
state.threshold = instance.getDataset().threshold
|
||||||
|
},
|
||||||
|
|
||||||
|
getDisabledType(value) {
|
||||||
|
return (typeof(value) === 'string' ? JSON.parse(value) : value) || false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取范围
|
||||||
|
* @param {Object} num
|
||||||
|
* @param {Object} min
|
||||||
|
* @param {Object} max
|
||||||
|
*/
|
||||||
|
range(num, min, max) {
|
||||||
|
return Math.min(Math.max(num, min), max);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动方向判断
|
||||||
|
* @param {Object} left
|
||||||
|
* @param {Object} value
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
* @param {Object} ins
|
||||||
|
*/
|
||||||
|
moveDirection(left, ins, ownerInstance, self) {
|
||||||
|
var state = self.state || {}
|
||||||
|
var threshold = state.threshold
|
||||||
|
var position = state.position
|
||||||
|
var isopen = state.isopen || 'none'
|
||||||
|
var leftWidth = state.leftWidth
|
||||||
|
var rightWidth = state.rightWidth
|
||||||
|
if (state.deltaX === 0) {
|
||||||
|
this.openState('none', ins, ownerInstance, self)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
|
||||||
|
rightWidth +
|
||||||
|
left < threshold)) {
|
||||||
|
// right
|
||||||
|
this.openState('right', ins, ownerInstance, self)
|
||||||
|
} else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
|
||||||
|
leftWidth - left < threshold)) {
|
||||||
|
// left
|
||||||
|
this.openState('left', ins, ownerInstance, self)
|
||||||
|
} else {
|
||||||
|
// default
|
||||||
|
this.openState('none', ins, ownerInstance, self)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启状态
|
||||||
|
* @param {Boolean} type
|
||||||
|
* @param {Object} ins
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
openState(type, ins, ownerInstance, self) {
|
||||||
|
let state = self.state || {}
|
||||||
|
let leftWidth = state.leftWidth
|
||||||
|
let rightWidth = state.rightWidth
|
||||||
|
let left = ''
|
||||||
|
state.isopen = state.isopen ? state.isopen : 'none'
|
||||||
|
switch (type) {
|
||||||
|
case "left":
|
||||||
|
left = leftWidth
|
||||||
|
break
|
||||||
|
case "right":
|
||||||
|
left = -rightWidth
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
left = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// && !state.throttle
|
||||||
|
|
||||||
|
if (state.isopen !== type) {
|
||||||
|
state.throttle = true
|
||||||
|
ownerInstance.callMethod('change', {
|
||||||
|
open: type
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
state.isopen = type
|
||||||
|
// 添加动画类
|
||||||
|
ins.requestAnimationFrame(() => {
|
||||||
|
ins.addClass('ani');
|
||||||
|
this.move(left, ins, ownerInstance, self)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
getDirection(x, y) {
|
||||||
|
if (x > y && x > MIN_DISTANCE) {
|
||||||
|
return 'horizontal';
|
||||||
|
}
|
||||||
|
if (y > x && y > MIN_DISTANCE) {
|
||||||
|
return 'vertical';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置滑动状态
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
resetTouchStatus(instance, self) {
|
||||||
|
let state = self.state || {};
|
||||||
|
state.direction = '';
|
||||||
|
state.deltaX = 0;
|
||||||
|
state.deltaY = 0;
|
||||||
|
state.offsetX = 0;
|
||||||
|
state.offsetY = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置滑动开始位置
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
stopTouchStart(event, ownerInstance, self) {
|
||||||
|
let instance = event.instance;
|
||||||
|
let state = self.state || {}
|
||||||
|
this.resetTouchStatus(instance, self);
|
||||||
|
var touch = event.touches[0];
|
||||||
|
state.startX = touch.clientX;
|
||||||
|
state.startY = touch.clientY;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 滑动中,是否禁止打开
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
stopTouchMove(event, self) {
|
||||||
|
let instance = event.instance;
|
||||||
|
let state = self.state || {};
|
||||||
|
let touch = event.touches[0];
|
||||||
|
|
||||||
|
state.deltaX = touch.clientX - state.startX;
|
||||||
|
state.deltaY = touch.clientY - state.startY;
|
||||||
|
state.offsetY = Math.abs(state.deltaY);
|
||||||
|
state.offsetX = Math.abs(state.deltaX);
|
||||||
|
state.direction = state.direction || this.getDirection(state.offsetX, state.offsetY);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,348 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
||||||
|
<!-- #ifdef APP-VUE || APP-HARMONY || MP-WEIXIN || H5 -->
|
||||||
|
<view class="uni-swipe">
|
||||||
|
<!-- #ifdef MP-WEIXIN || H5 -->
|
||||||
|
<view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
||||||
|
:data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
|
||||||
|
@touchend="wxsswipe.touchend">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN || H5 -->
|
||||||
|
<view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
||||||
|
:data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
|
||||||
|
@touchend="renderswipe.touchend">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
||||||
|
<view class="uni-swipe_button-group button-group--left">
|
||||||
|
<slot name="left">
|
||||||
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
|
@touchend.stop="appTouchEnd($event,index,item,'left')" @click.stop="onClickForPC(index,item,'left')">
|
||||||
|
<text class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
<view class="uni-swipe_text--center">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
<view class="uni-swipe_button-group button-group--right">
|
||||||
|
<slot name="right">
|
||||||
|
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
|
@touchend.stop="appTouchEnd($event,index,item,'right')" @click.stop="onClickForPC(index,item,'right')"><text
|
||||||
|
class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- app nvue端 使用 bindingx -->
|
||||||
|
<!-- #ifdef APP-NVUE -->
|
||||||
|
<view ref="selector-box--hock" class="uni-swipe" @horizontalpan="touchstart" @touchend="touchend">
|
||||||
|
<view ref='selector-left-button--hock' class="uni-swipe_button-group button-group--left">
|
||||||
|
<slot name="left">
|
||||||
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
|
}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')">
|
||||||
|
<text class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">
|
||||||
|
{{ item.text }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
<view ref='selector-right-button--hock' class="uni-swipe_button-group button-group--right">
|
||||||
|
<slot name="right">
|
||||||
|
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
|
}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'right')"><text
|
||||||
|
class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
<view ref='selector-content--hock' class="uni-swipe_box">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- 其他平台使用 js ,长列表性能可能会有影响-->
|
||||||
|
<!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ || MP-HARMONY -->
|
||||||
|
<view class="uni-swipe">
|
||||||
|
<view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
|
||||||
|
:style="{transform:moveLeft}" :class="{ani:ani}">
|
||||||
|
<view class="uni-swipe_button-group button-group--left" :class="[elClass]">
|
||||||
|
<slot name="left">
|
||||||
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
||||||
|
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
||||||
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
|
@touchend.stop="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
<slot></slot>
|
||||||
|
<view class="uni-swipe_button-group button-group--right" :class="[elClass]">
|
||||||
|
<slot name="right">
|
||||||
|
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
||||||
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
||||||
|
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
||||||
|
}" @touchstart.stop="appTouchStart" @touchend.stop="appTouchEnd($event,index,item,'right')"
|
||||||
|
class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
|
||||||
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script src="./wx.wxs" module="wxsswipe" lang="wxs"></script>
|
||||||
|
|
||||||
|
<script module="renderswipe" lang="renderjs">
|
||||||
|
import render from './render.js'
|
||||||
|
export default {
|
||||||
|
mounted(e, ins, owner) {
|
||||||
|
this.state = {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showWatch(newVal, oldVal, ownerInstance, instance) {
|
||||||
|
render.showWatch(newVal, oldVal, ownerInstance, instance, this)
|
||||||
|
},
|
||||||
|
touchstart(e, ownerInstance) {
|
||||||
|
render.touchstart(e, ownerInstance, this)
|
||||||
|
},
|
||||||
|
touchmove(e, ownerInstance) {
|
||||||
|
render.touchmove(e, ownerInstance, this)
|
||||||
|
},
|
||||||
|
touchend(e, ownerInstance) {
|
||||||
|
render.touchend(e, ownerInstance, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
import mpwxs from './mpwxs'
|
||||||
|
import bindingx from './bindingx.js'
|
||||||
|
import mpother from './mpother'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SwipeActionItem 滑动操作子组件
|
||||||
|
* @description 通过滑动触发选项的容器
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=181
|
||||||
|
* @property {Boolean} show = [left|right|none] 开启关闭组件,auto-close = false 时生效
|
||||||
|
* @property {Boolean} disabled = [true|false] 是否禁止滑动
|
||||||
|
* @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
|
||||||
|
* @property {Number} threshold 滑动缺省值
|
||||||
|
* @property {Array} leftOptions 左侧选项内容及样式
|
||||||
|
* @property {Array} rightOptions 右侧选项内容及样式
|
||||||
|
* @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
|
||||||
|
* @event {Function} change 组件打开或关闭时触发,left\right\none
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [mpwxs, bindingx, mpother],
|
||||||
|
emits: ['click', 'change'],
|
||||||
|
props: {
|
||||||
|
// 控制开关
|
||||||
|
show: {
|
||||||
|
type: String,
|
||||||
|
default: 'none'
|
||||||
|
},
|
||||||
|
|
||||||
|
// 禁用
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
// 是否自动关闭
|
||||||
|
autoClose: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
|
||||||
|
// 滑动缺省距离
|
||||||
|
threshold: {
|
||||||
|
type: Number,
|
||||||
|
default: 20
|
||||||
|
},
|
||||||
|
|
||||||
|
// 左侧按钮内容
|
||||||
|
leftOptions: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 右侧按钮内容
|
||||||
|
rightOptions: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// #ifndef VUE3
|
||||||
|
// TODO vue2
|
||||||
|
destroyed() {
|
||||||
|
if (this.__isUnmounted) return
|
||||||
|
this.uninstall()
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
// TODO vue3
|
||||||
|
unmounted() {
|
||||||
|
this.__isUnmounted = true
|
||||||
|
this.uninstall()
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
uninstall() {
|
||||||
|
if (this.swipeaction) {
|
||||||
|
this.swipeaction.children.forEach((item, index) => {
|
||||||
|
if (item === this) {
|
||||||
|
this.swipeaction.children.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取父元素实例
|
||||||
|
*/
|
||||||
|
getSwipeAction(name = 'uniSwipeAction') {
|
||||||
|
let parent = this.$parent;
|
||||||
|
let parentName = parent.$options.name;
|
||||||
|
while (parentName !== name) {
|
||||||
|
parent = parent.$parent;
|
||||||
|
if (!parent) return false;
|
||||||
|
parentName = parent.$options.name;
|
||||||
|
}
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.uni-swipe {
|
||||||
|
position: relative;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
overflow: hidden;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_box {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
// touch-action: none;
|
||||||
|
/* #endif */
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_content {
|
||||||
|
// border: 1px red solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_text--center {
|
||||||
|
width: 100%;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
cursor: grab;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_button-group {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group--left {
|
||||||
|
left: 0;
|
||||||
|
transform: translateX(-100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group--right {
|
||||||
|
right: 0;
|
||||||
|
transform: translateX(100%)
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_button {
|
||||||
|
/* #ifdef APP-NVUE */
|
||||||
|
flex: 1;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-swipe_button-text {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
flex-shrink: 0;
|
||||||
|
/* #endif */
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ani {
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 0.3s;
|
||||||
|
transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #ifdef MP-ALIPAY */
|
||||||
|
.movable-area {
|
||||||
|
/* width: 100%; */
|
||||||
|
height: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.movable-view {
|
||||||
|
display: flex;
|
||||||
|
/* justify-content: center; */
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
height: 45px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.movable-view-button {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: row;
|
||||||
|
height: 100%;
|
||||||
|
background: #C0C0C0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .transition {
|
||||||
|
transition: all 0.3s;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.movable-view-box {
|
||||||
|
flex-shrink: 0;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
var MIN_DISTANCE = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前是否为H5、app-vue
|
||||||
|
*/
|
||||||
|
var IS_HTML5 = false
|
||||||
|
if (typeof window === 'object') IS_HTML5 = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听页面内值的变化,主要用于动态开关swipe-action
|
||||||
|
* @param {Object} newValue
|
||||||
|
* @param {Object} oldValue
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
* @param {Object} instance
|
||||||
|
*/
|
||||||
|
function showWatch(newVal, oldVal, ownerInstance, instance) {
|
||||||
|
var state = instance.getState()
|
||||||
|
getDom(instance, ownerInstance)
|
||||||
|
if (newVal && newVal !== 'none') {
|
||||||
|
openState(newVal, instance, ownerInstance)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.left) {
|
||||||
|
openState('none', instance, ownerInstance)
|
||||||
|
}
|
||||||
|
resetTouchStatus(instance)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始触摸操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ins
|
||||||
|
*/
|
||||||
|
function touchstart(e, ownerInstance) {
|
||||||
|
var instance = e.instance;
|
||||||
|
var disabled = instance.getDataset().disabled
|
||||||
|
var state = instance.getState();
|
||||||
|
getDom(instance, ownerInstance)
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||||
|
if (disabled) return
|
||||||
|
// 开始触摸时移除动画类
|
||||||
|
instance.requestAnimationFrame(function() {
|
||||||
|
instance.removeClass('ani');
|
||||||
|
ownerInstance.callMethod('closeSwipe');
|
||||||
|
})
|
||||||
|
|
||||||
|
// 记录上次的位置
|
||||||
|
state.x = state.left || 0
|
||||||
|
// 计算滑动开始位置
|
||||||
|
stopTouchStart(e, ownerInstance)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始滑动操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
function touchmove(e, ownerInstance) {
|
||||||
|
var instance = e.instance;
|
||||||
|
var disabled = instance.getDataset().disabled
|
||||||
|
var state = instance.getState()
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||||
|
if (disabled) return
|
||||||
|
// 是否可以滑动页面
|
||||||
|
stopTouchMove(e);
|
||||||
|
if (state.direction !== 'horizontal') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.preventDefault) {
|
||||||
|
// 阻止页面滚动
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
move(state.x + state.deltaX, instance, ownerInstance)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束触摸操作
|
||||||
|
* @param {Object} e
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
function touchend(e, ownerInstance) {
|
||||||
|
var instance = e.instance;
|
||||||
|
var disabled = instance.getDataset().disabled
|
||||||
|
var state = instance.getState()
|
||||||
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
|
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||||
|
|
||||||
|
if (disabled) return
|
||||||
|
// 滑动过程中触摸结束,通过阙值判断是开启还是关闭
|
||||||
|
// fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
|
||||||
|
moveDirection(state.left, instance, ownerInstance)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置移动距离
|
||||||
|
* @param {Object} value
|
||||||
|
* @param {Object} instance
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
function move(value, instance, ownerInstance) {
|
||||||
|
value = value || 0
|
||||||
|
var state = instance.getState()
|
||||||
|
var leftWidth = state.leftWidth
|
||||||
|
var rightWidth = state.rightWidth
|
||||||
|
// 获取可滑动范围
|
||||||
|
state.left = range(value, -rightWidth, leftWidth);
|
||||||
|
instance.requestAnimationFrame(function() {
|
||||||
|
instance.setStyle({
|
||||||
|
transform: 'translateX(' + state.left + 'px)',
|
||||||
|
'-webkit-transform': 'translateX(' + state.left + 'px)'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取元素信息
|
||||||
|
* @param {Object} instance
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
function getDom(instance, ownerInstance) {
|
||||||
|
var state = instance.getState()
|
||||||
|
var leftDom = ownerInstance.selectComponent('.button-group--left')
|
||||||
|
var rightDom = ownerInstance.selectComponent('.button-group--right')
|
||||||
|
var leftStyles = {
|
||||||
|
width: 0
|
||||||
|
}
|
||||||
|
var rightStyles = {
|
||||||
|
width: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leftDom) {
|
||||||
|
leftStyles = leftDom.getBoundingClientRect()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rightDom) {
|
||||||
|
rightStyles = rightDom.getBoundingClientRect()
|
||||||
|
}
|
||||||
|
state.leftWidth = leftStyles.width || 0
|
||||||
|
state.rightWidth = rightStyles.width || 0
|
||||||
|
state.threshold = instance.getDataset().threshold
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取范围
|
||||||
|
* @param {Object} num
|
||||||
|
* @param {Object} min
|
||||||
|
* @param {Object} max
|
||||||
|
*/
|
||||||
|
function range(num, min, max) {
|
||||||
|
return Math.min(Math.max(num, min), max);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动方向判断
|
||||||
|
* @param {Object} left
|
||||||
|
* @param {Object} value
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
* @param {Object} ins
|
||||||
|
*/
|
||||||
|
function moveDirection(left, ins, ownerInstance) {
|
||||||
|
var state = ins.getState()
|
||||||
|
var threshold = state.threshold
|
||||||
|
var position = state.position
|
||||||
|
var isopen = state.isopen || 'none'
|
||||||
|
var leftWidth = state.leftWidth
|
||||||
|
var rightWidth = state.rightWidth
|
||||||
|
if (state.deltaX === 0) {
|
||||||
|
openState('none', ins, ownerInstance)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
|
||||||
|
rightWidth +
|
||||||
|
left < threshold)) {
|
||||||
|
// right
|
||||||
|
openState('right', ins, ownerInstance)
|
||||||
|
} else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
|
||||||
|
leftWidth - left < threshold)) {
|
||||||
|
// left
|
||||||
|
openState('left', ins, ownerInstance)
|
||||||
|
} else {
|
||||||
|
// default
|
||||||
|
openState('none', ins, ownerInstance)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启状态
|
||||||
|
* @param {Boolean} type
|
||||||
|
* @param {Object} ins
|
||||||
|
* @param {Object} ownerInstance
|
||||||
|
*/
|
||||||
|
function openState(type, ins, ownerInstance) {
|
||||||
|
var state = ins.getState()
|
||||||
|
var leftWidth = state.leftWidth
|
||||||
|
var rightWidth = state.rightWidth
|
||||||
|
var left = ''
|
||||||
|
state.isopen = state.isopen ? state.isopen : 'none'
|
||||||
|
switch (type) {
|
||||||
|
case "left":
|
||||||
|
left = leftWidth
|
||||||
|
break
|
||||||
|
case "right":
|
||||||
|
left = -rightWidth
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
left = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// && !state.throttle
|
||||||
|
|
||||||
|
if (state.isopen !== type) {
|
||||||
|
state.throttle = true
|
||||||
|
ownerInstance.callMethod('change', {
|
||||||
|
open: type
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
state.isopen = type
|
||||||
|
// 添加动画类
|
||||||
|
ins.requestAnimationFrame(function() {
|
||||||
|
ins.addClass('ani');
|
||||||
|
move(left, ins, ownerInstance)
|
||||||
|
})
|
||||||
|
// 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getDirection(x, y) {
|
||||||
|
if (x > y && x > MIN_DISTANCE) {
|
||||||
|
return 'horizontal';
|
||||||
|
}
|
||||||
|
if (y > x && y > MIN_DISTANCE) {
|
||||||
|
return 'vertical';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置滑动状态
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
function resetTouchStatus(instance) {
|
||||||
|
var state = instance.getState();
|
||||||
|
state.direction = '';
|
||||||
|
state.deltaX = 0;
|
||||||
|
state.deltaY = 0;
|
||||||
|
state.offsetX = 0;
|
||||||
|
state.offsetY = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置滑动开始位置
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
function stopTouchStart(event) {
|
||||||
|
var instance = event.instance;
|
||||||
|
var state = instance.getState();
|
||||||
|
resetTouchStatus(instance);
|
||||||
|
var touch = event.touches[0];
|
||||||
|
if (IS_HTML5 && isPC()) {
|
||||||
|
touch = event;
|
||||||
|
}
|
||||||
|
state.startX = touch.clientX;
|
||||||
|
state.startY = touch.clientY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 滑动中,是否禁止打开
|
||||||
|
* @param {Object} event
|
||||||
|
*/
|
||||||
|
function stopTouchMove(event) {
|
||||||
|
var instance = event.instance;
|
||||||
|
var state = instance.getState();
|
||||||
|
var touch = event.touches[0];
|
||||||
|
if (IS_HTML5 && isPC()) {
|
||||||
|
touch = event;
|
||||||
|
}
|
||||||
|
state.deltaX = touch.clientX - state.startX;
|
||||||
|
state.deltaY = touch.clientY - state.startY;
|
||||||
|
state.offsetY = Math.abs(state.deltaY);
|
||||||
|
state.offsetX = Math.abs(state.deltaX);
|
||||||
|
state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPC() {
|
||||||
|
var userAgentInfo = navigator.userAgent;
|
||||||
|
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||||
|
var flag = true;
|
||||||
|
for (var v = 0; v < Agents.length - 1; v++) {
|
||||||
|
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(userAgentInfo.indexOf('Phone') > 0 && userAgentInfo.indexOf('Harmony') > 0){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
var movable = false
|
||||||
|
|
||||||
|
function mousedown(e, ins) {
|
||||||
|
if (!IS_HTML5) return
|
||||||
|
if (!isPC()) return
|
||||||
|
touchstart(e, ins)
|
||||||
|
movable = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function mousemove(e, ins) {
|
||||||
|
if (!IS_HTML5) return
|
||||||
|
if (!isPC()) return
|
||||||
|
if (!movable) return
|
||||||
|
touchmove(e, ins)
|
||||||
|
}
|
||||||
|
|
||||||
|
function mouseup(e, ins) {
|
||||||
|
if (!IS_HTML5) return
|
||||||
|
if (!isPC()) return
|
||||||
|
touchend(e, ins)
|
||||||
|
movable = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function mouseleave(e, ins) {
|
||||||
|
if (!IS_HTML5) return
|
||||||
|
if (!isPC()) return
|
||||||
|
movable = false
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
showWatch: showWatch,
|
||||||
|
touchstart: touchstart,
|
||||||
|
touchmove: touchmove,
|
||||||
|
touchend: touchend,
|
||||||
|
mousedown: mousedown,
|
||||||
|
mousemove: mousemove,
|
||||||
|
mouseup: mouseup,
|
||||||
|
mouseleave: mouseleave
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* SwipeAction 滑动操作
|
||||||
|
* @description 通过滑动触发选项的容器
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=181
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name:"uniSwipeAction",
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.children = [];
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 公开给用户使用,重制组件样式
|
||||||
|
resize(){
|
||||||
|
// wxs 会自己计算组件大小,所以无需执行下面代码
|
||||||
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
|
this.children.forEach(vm=>{
|
||||||
|
vm.init()
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
// 公开给用户使用,关闭全部 已经打开的组件
|
||||||
|
closeAll(){
|
||||||
|
this.children.forEach(vm=>{
|
||||||
|
// #ifdef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
|
vm.is_show = 'none'
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
|
vm.close()
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closeOther(vm) {
|
||||||
|
if (this.openItem && this.openItem !== vm) {
|
||||||
|
// #ifdef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
|
this.openItem.is_show = 'none'
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
|
this.openItem.close()
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
// 记录上一个打开的 swipe-action-item ,用于 auto-close
|
||||||
|
this.openItem = vm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
112
uni_modules/uni-swipe-action/package.json
Normal file
112
uni_modules/uni-swipe-action/package.json
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-swipe-action",
|
||||||
|
"displayName": "uni-swipe-action 滑动操作",
|
||||||
|
"version": "1.3.16",
|
||||||
|
"description": "SwipeAction 滑动操作操作组件",
|
||||||
|
"keywords": [
|
||||||
|
"",
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"滑动删除",
|
||||||
|
"侧滑删除"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "",
|
||||||
|
"uni-app": "^4.27",
|
||||||
|
"uni-app-x": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||||
|
"type": "component-vue",
|
||||||
|
"darkmode": "x",
|
||||||
|
"i18n": "x",
|
||||||
|
"widescreen": "x"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [
|
||||||
|
"uni-scss"
|
||||||
|
],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "x",
|
||||||
|
"aliyun": "x",
|
||||||
|
"alipay": "x"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"uni-app": {
|
||||||
|
"vue": {
|
||||||
|
"vue2": {
|
||||||
|
"extVersion": "1.3.14",
|
||||||
|
"minVersion": ""
|
||||||
|
},
|
||||||
|
"vue3": {
|
||||||
|
"extVersion": "1.3.14",
|
||||||
|
"minVersion": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"safari": "-",
|
||||||
|
"chrome": "-"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"vue": "-",
|
||||||
|
"nvue": "-",
|
||||||
|
"android": "-",
|
||||||
|
"ios": "-",
|
||||||
|
"harmony": "-"
|
||||||
|
},
|
||||||
|
"mp": {
|
||||||
|
"weixin": "-",
|
||||||
|
"alipay": "-",
|
||||||
|
"toutiao": "-",
|
||||||
|
"baidu": "-",
|
||||||
|
"kuaishou": "-",
|
||||||
|
"jd": "-",
|
||||||
|
"harmony": "-",
|
||||||
|
"qq": "-",
|
||||||
|
"lark": "-"
|
||||||
|
},
|
||||||
|
"quickapp": {
|
||||||
|
"huawei": "-",
|
||||||
|
"union": "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uni-app-x": {
|
||||||
|
"web": {
|
||||||
|
"safari": "-",
|
||||||
|
"chrome": "-"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"android": "-",
|
||||||
|
"ios": "-",
|
||||||
|
"harmony": "-"
|
||||||
|
},
|
||||||
|
"mp": {
|
||||||
|
"weixin": "-"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
uni_modules/uni-swipe-action/readme.md
Normal file
11
uni_modules/uni-swipe-action/readme.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## SwipeAction 滑动操作
|
||||||
|
> **组件名:uni-swipe-action**
|
||||||
|
> 代码块: `uSwipeAction`、`uSwipeActionItem`
|
||||||
|
|
||||||
|
|
||||||
|
通过滑动触发选项的容器
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-swipe-action)
|
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||||
@@ -6,23 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
// 应用全局配置
|
// 应用全局配置
|
||||||
let exports = {
|
let exports = {
|
||||||
|
|
||||||
|
|
||||||
// baseUrl: 'http://127.0.0.1:8903', // 本地开发
|
|
||||||
|
|
||||||
// baseUrl: 'http://172.20.0.104:8903', // xubaiqi 地址
|
|
||||||
|
|
||||||
// baseUrl: 'http://172.20.1.76:8903', // 演示环境内网
|
|
||||||
|
|
||||||
// baseUrl: 'http://36.140.162.216:8904/prod-api', // 演示环境外网
|
|
||||||
|
|
||||||
// baseUrl: 'http://10.160.0.5:8903', // 演示环境外网
|
|
||||||
|
|
||||||
// baseUrl: 'http://111.34.80.140:8081/prod-api', // 正式环境(不要轻易连接)
|
|
||||||
|
|
||||||
baseUrl: 'http://10.160.0.5:8907', // 正式环境在济南人才上部署(不要轻易连接)
|
baseUrl: 'http://10.160.0.5:8907', // 正式环境在济南人才上部署(不要轻易连接)
|
||||||
|
// baseUrl: 'http://172.20.0.177:8903', // 正式环境在济南人才上部署(不要轻易连接)
|
||||||
|
|
||||||
|
|
||||||
// 应用信息
|
// 应用信息
|
||||||
appInfo: {
|
appInfo: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import constant from '@/utilsRc/constant'
|
|||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
// logout,
|
// logout,
|
||||||
// getInfo,
|
getInfo,
|
||||||
// register,
|
// register,
|
||||||
// smsLogin,
|
// smsLogin,
|
||||||
// wechatLogin
|
// wechatLogin
|
||||||
|
|||||||
Reference in New Issue
Block a user