diff --git a/apis/index.js b/apis/index.js
index ec79c85..dd9661c 100644
--- a/apis/index.js
+++ b/apis/index.js
@@ -10,6 +10,7 @@ import store from '@/store'
// 基础配置
const config = {
apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
+ apiUrls : 'http://api.ahxh.shangkelian.cn',
timeout : 60000
}
@@ -154,5 +155,6 @@ const loginHint = () => {
export {
request,
- uploading
+ uploading,
+ config
}
diff --git a/apis/interfaces/mine.js b/apis/interfaces/mine.js
index d154f62..e838a28 100644
--- a/apis/interfaces/mine.js
+++ b/apis/interfaces/mine.js
@@ -69,7 +69,7 @@ const browsers = (page) => {
// 修改用户头像或昵称
const resetUserInfo= (data) => {
return request({
- url: 'user/'+data.key,
+ url: 'user/setting/'+data.key,
method: 'PUT',
data:{
value:data.value
diff --git a/apis/interfaces/news.js b/apis/interfaces/news.js
new file mode 100644
index 0000000..644d82f
--- /dev/null
+++ b/apis/interfaces/news.js
@@ -0,0 +1,53 @@
+/**
+ * Web-zdx
+ * moduleName: 通知消息列表
+ */
+
+import {request} from '../index.js'
+
+// 消息列表
+const notificationsType = () => {
+ return request({
+ url: 'notifications',
+ method: 'GET'
+ })
+}
+// 根据type 获取具体消息列表
+const notificationsList = (type,data) => {
+ return request({
+ url: 'notifications/'+type+'/list',
+ method: 'GET',
+ data:data
+ })
+}
+// 根据type 全部已读
+const notificationsReaded = (type) => {
+ return request({
+ url: 'notifications/'+type,
+ method: 'PUT'
+ })
+}
+// 根据type 全部已读
+const notificationsDelete= () => {
+ return request({
+ url: 'notifications',
+ method: 'DELETE'
+ })
+}
+// 根据消息id获取消息详情
+const notificationsDetail= (id) => {
+ return request({
+ url: 'notifications/'+id,
+ method: 'get'
+ })
+}
+
+
+
+export {
+ notificationsType,
+ notificationsList,
+ notificationsDetail,
+ notificationsReaded,
+ notificationsDelete
+}
diff --git a/apis/interfaces/setting.js b/apis/interfaces/setting.js
index 956163f..f903b7c 100644
--- a/apis/interfaces/setting.js
+++ b/apis/interfaces/setting.js
@@ -25,7 +25,7 @@ const wechatbind = (data) => {
// 修改用户头像或昵称
const resetUserInfo = (data) => {
return request({
- url: 'user/' + data.key,
+ url: 'user/setting/' + data.key,
method: 'PUT',
data: {
value: data.value
@@ -71,6 +71,13 @@ const aboutUs = () => {
url: 'articles/about'
})
}
+// 获取企业认证状态 -1.未认证,0.审核中,1.审核通过,2.驳回
+const companyStatus = () => {
+ return request({
+ url: 'companies/applies/query'
+ })
+}
+
export {
login,
@@ -80,5 +87,6 @@ export {
agreementLogin,
resetUserInfo,
getUserSettingInfo,
- aboutUs
+ aboutUs,
+ companyStatus
}
diff --git a/apis/interfaces/wallet.js b/apis/interfaces/wallet.js
new file mode 100644
index 0000000..b383342
--- /dev/null
+++ b/apis/interfaces/wallet.js
@@ -0,0 +1,159 @@
+
+/**
+ * Web唐明明
+ * 匆匆数载恍如梦,岁月迢迢华发增。
+ * 碌碌无为枉半生,一朝惊醒万事空。
+ * moduleName: 钱包
+ */
+
+import {request} from '../index.js'
+
+// 导出助记词
+const seed = () => {
+ return request({
+ url: 'chain/safe/seed'
+ })
+}
+
+const hash = (data) => {
+ return request({
+ url: 'chain/wallet/hash',
+ method: 'POST',
+ data: data
+ })
+}
+
+// 收款码
+const code = () => {
+ return request({
+ url: 'chain/account/code'
+ })
+}
+
+// 原石余额
+const sum = () => {
+ return request({
+ url: 'chain/account/balance'
+ })
+}
+
+// 原石价格
+const price = () => {
+ return request({
+ url: 'nodes/price'
+ })
+}
+
+// 账户记录
+const logs = (data) => {
+ return request({
+ url: 'chain/account/logs',
+ data: data
+ })
+}
+
+// 设置安全密码
+const security = (data) => {
+ return request({
+ url: 'chain/safe/security',
+ method: 'POST',
+ data
+ })
+}
+
+// 转账
+const transfer = (data) => {
+ return request({
+ url: 'chain/account/transfer',
+ method: 'POST',
+ data
+ })
+}
+
+// 钱包私钥
+const privatekey = (code) => {
+ return request({
+ url : "chain/safe/private_key",
+ data: {
+ code
+ }
+ })
+}
+
+// 获取可提现信息
+const withdraw = () => {
+ return request({
+ url : "withdraw"
+ })
+}
+
+// 提现记录
+const withdrawLogs = (data) => {
+ return request({
+ url : "withdraw/logs",
+ data:data
+ })
+}
+
+// 提现
+const withdrawDo = (data) => {
+ return request({
+ url : "withdraw",
+ method: 'POST',
+ data:data
+ })
+}
+
+// 验证支付密码是否正确
+const securityCheck = (password) => {
+ return request({
+ url : "chain/safe/security/check",
+ method: 'POST',
+ data:{
+ code : password,
+ }
+ })
+}
+
+// 修改密码
+const securityReset = (data) => {
+ return request({
+ url : "chain/safe/security",
+ method: 'PUT',
+ data:data
+ })
+}
+
+// 提现服务条款
+const cmsWithdraw = () => {
+ return request({
+ url : "cms/withdraw"
+ })
+}
+
+// 私钥规则
+const keyrules = () => {
+ return request({
+ url: 'cms/keyrules'
+ })
+}
+
+export {
+ seed,
+ hash,
+ code,
+ sum,
+ price,
+ logs,
+ security,
+ transfer,
+ privatekey,
+ withdraw,
+ withdrawLogs,
+ withdrawDo,
+ securityCheck,
+ securityReset,
+ cmsWithdraw,
+ keyrules
+}
+
diff --git a/components/no-list-components/index.vue b/components/no-list-components/index.vue
new file mode 100644
index 0000000..85d597f
--- /dev/null
+++ b/components/no-list-components/index.vue
@@ -0,0 +1,72 @@
+
+
+
+
+ {{txt}}
+
+
+
+
+
+
+
diff --git a/components/numberJpan/numberJpan.vue b/components/numberJpan/numberJpan.vue
new file mode 100644
index 0000000..c8017b1
--- /dev/null
+++ b/components/numberJpan/numberJpan.vue
@@ -0,0 +1,238 @@
+
+
+
+
+ ×
+
+ 请输入支付密码
+
+
+
+
+ {{showNum?arr[i]==null?'':arr[i]:arr[i]!=null?"●" : ""}}
+
+
+ {{showNum?arr[i-1]==null?'':arr[i-1]:arr[i-1]!=null?"●" : ""}}
+
+
+
+
+
+
+
+
+
+
+ {{i+1}}
+
+
+ {{i}}
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/property/record.vue b/components/property/record.vue
new file mode 100644
index 0000000..a5a5ccd
--- /dev/null
+++ b/components/property/record.vue
@@ -0,0 +1,93 @@
+
+
+
+
+ {{item.hash || '-'}}
+ {{item.block_time || '-'}}
+
+ {{item.is_in ? '+': '-'}}{{item.amount}}
+ {{item.assets.symbol}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/main.js b/main.js
index 11f608a..6c51a8d 100644
--- a/main.js
+++ b/main.js
@@ -4,7 +4,8 @@ import App from './App'
import Vue from 'vue'
import { router, RouterMount } from './router'
import store from './store'
-import uView from 'uview-ui'
+import uView from 'uview-ui'
+import noList from './components/no-list-components/index.vue'
Vue.use(router)
Vue.use(uView);
Vue.config.productionTip = false
@@ -12,7 +13,8 @@ Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
...App
-})
+})
+Vue.component('no-list',noList)
// #ifdef H5
RouterMount(app,router,'#app')
// #endif
diff --git a/pages.json b/pages.json
index 7de6ca3..2cfab87 100644
--- a/pages.json
+++ b/pages.json
@@ -149,6 +149,104 @@
"style": {
"navigationBarTitleText": "企业认证"
}
+ }, {
+ "path": "pages/news/index",
+ "name": "news",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "消息中心"
+ }
+ }, {
+ "path": "pages/news/detail",
+ "name": "newsDetail",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "消息列表"
+ }
+ }, {
+ "path": "pages/wallet/property",
+ "name": "walletProperty",
+ "style": {
+ "navigationBarTitleText": "能量钱包",
+ "enablePullDownRefresh": false,
+ "navigationBarTextStyle": "white"
+ }
+ }, {
+ "path": "pages/wallet/extract",
+ "style": {
+ "navigationBarTitleText": "提现能量",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#774ffd",
+ "navigationBarTextStyle": "white"
+ },
+ "name": "Extract"
+ }, {
+ "path": "pages/wallet/resetPassword",
+ "style": {
+ "navigationBarTitleText": "重置密码",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#774ffd",
+ "navigationBarTextStyle": "white"
+ },
+ "name": "ResetPassword"
+ },{
+ "path": "pages/verification/index",
+ "name": "verificationIndex",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "扫码核销"
+ }
+ },{
+ "path": "pages/verification/history",
+ "name": "verificationHistory",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "核销记录"
+ }
+ },{
+ "path": "pages/shop/lists",
+ "name": "shopLists",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "部门/门店"
+ }
+ },{
+ "path": "pages/shop/create",
+ "name": "shopCreate",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "创建部门/门店"
+ }
+ },{
+ "path": "pages/employees/list",
+ "name": "employeesList",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "员工管理"
+ }
+ },{
+ "path": "pages/employees/add",
+ "name": "employeesAdd",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "添加员工"
+ }
+ },{
+ "path": "pages/instrument/Spread",
+ "name": "instrumentSpread",
+ "auth": true,
+ "style": {
+ "navigationBarTitleText": "营销推广码"
+ }
+ }, {
+ "path": "pages/wallet/fragment",
+ "style": {
+ "navigationBarTitleText": "能量碎片记录",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#774ffd",
+ "navigationBarTextStyle": "white"
+ },
+ "name": "Fragment"
}],
"globalStyle": {
"navigationStyle": "custom",
@@ -181,4 +279,4 @@
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
-}
\ No newline at end of file
+}
diff --git a/pages/employees/add.vue b/pages/employees/add.vue
new file mode 100644
index 0000000..ed32964
--- /dev/null
+++ b/pages/employees/add.vue
@@ -0,0 +1,311 @@
+
+
+
+
+
+
+
+
+
+
+
+ 员工寸照
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{section[sectionIndex].name}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 权限设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/employees/list.vue b/pages/employees/list.vue
new file mode 100644
index 0000000..5b39527
--- /dev/null
+++ b/pages/employees/list.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+ {{listItem.name}}
+
+
+
+
+
+
+
+ {{item.name.slice(0,1)}}
+
+
+
+
+
+ {{item.name}}{{item.job}}
+
+ {{permissionItem}}
+
+
+
+
+
+
+
+
+ 店铺暂无员工
+
+
+
+
+
+
+ 暂未添加员工
+ 添加员工
+
+
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 41cadb8..0d35411 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,51 +1,60 @@
-
-
-
-
-
-
- {{item.nickname}} {{item.title}} {{item.amount}}
-
-
-
-
-
-
-
-
- {{isAuth ? '持有原石量': '恒量发行原石量'}}
- {{occ}}
- 立即登录
- 我的钱包
+
+ 能量球 99
+ 能量碎片 11
+
+
+
+
+
+
+
+
+
+
+
+ 能量碎片{{ item.amount || '-'}}
+
+
+
+ 购物
+
-
-
+
+
+
+ {{ item.remark }}
+
+
+
+ {{ item.title }}
+
+
@@ -93,11 +102,10 @@
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
export default {
- components: {
- lF2
- },
data() {
return {
+ crystalArr : [],
+ categoryArr : [],
occs: {},
blockHeight: 0,
occBalance: 0,
@@ -125,8 +133,8 @@
// 求助信息
showHelp(type) {
uni.showModal({
- title: '提示',
- content: this.helpToast[type],
+ title: '提示',
+ content: this.helpToast[type],
showCancel: false
})
},
@@ -179,6 +187,7 @@
// occ信息
getOcc(){
occ().then(res => {
+ console.log(res)
this.occs = res.occs
this.yesterdayCrystal = res.yesterday_crystal
this.occ = res.occ
@@ -190,7 +199,10 @@
if(res.help_toast) this.helpToast = res.help_toast
this.showCartc(res.movements)
}).catch(err => {
- console.log(err)
+ uni.showToast({
+ title: err.message,
+ icon : 'none'
+ })
})
},
// 绘制图表
@@ -264,154 +276,100 @@
-
diff --git a/pages/instrument/Spread.vue b/pages/instrument/Spread.vue
new file mode 100644
index 0000000..48c53b6
--- /dev/null
+++ b/pages/instrument/Spread.vue
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+ {{companyInfo.name}}
+ 易货平台
+
+
+
+
+
+
+
+
+ 扫码推广
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/news/detail.vue b/pages/news/detail.vue
new file mode 100644
index 0000000..7687a4e
--- /dev/null
+++ b/pages/news/detail.vue
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+ {{item.title}}
+
+ {{item.content}}
+ {{item.created_at}}
+
+
+
+
+
+
+
+
+
diff --git a/pages/news/index.vue b/pages/news/index.vue
new file mode 100644
index 0000000..452e1fb
--- /dev/null
+++ b/pages/news/index.vue
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ {{item.title || '暂无任何未读消息'}}
+
+
+ {{item.count}}
+
+
+
+
+ 暂时没有收到任何消息~
+
+
+
+
+
+
+
diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue
index 82949ad..3bfdf4d 100644
--- a/pages/setting/setting.vue
+++ b/pages/setting/setting.vue
@@ -33,20 +33,28 @@
-
+
个人认证
-
+
+
+
+
-
+
企业认证
-
+
+
+
+
@@ -80,7 +88,8 @@
import {
wechatbind,
resetUserInfo,
- getUserSettingInfo
+ getUserSettingInfo,
+ companyStatus
} from '@/apis/interfaces/setting'
import {
uploads
@@ -96,8 +105,8 @@
showPath: ''
},
is_bind: true, // 微信绑定
- is_certification: true, // 个人认证
- is_company: true, // 企业认证
+ certification: {}, // 个人认证
+ companyCode: {}, // 企业认证 -1.未认证,0.审核中,1.审核通过,2.驳回
}
},
onShow() {
@@ -107,38 +116,59 @@
}
})
this.getUserInfo()
+
},
onPullDownRefresh() {
this.getUserInfo()
},
methods: {
// 是否个人认证
- certification(is_certfication) {
- console.log(is_certfication)
- if (is_certfication) {
+ certificationClick(certfication) {
+ console.log(certfication)
+ if (certfication.is_true) {
// 跳转到个人认证信息完成展示页面
- this.$router.push({
- name: ''
+ // this.$refs.uToast.show({
+ // title: '认证通过!',
+ // type: 'primary',
+ // duration: 3000
+ // })
+ uni.showModal({
+ title: '认证信息',
+ content: '真实姓名:<' + certfication.message.name + '>,身份证号:' + certfication.message.idcard,
+ showCancel:false
})
} else {
// 跳转到个人认证信息页面
- this.$router.push({
- name: ''
+ uni.navigateTo({
+ url: '/pages/certification/personal'
})
}
},
- // 是否展示企业信息
- company(is_company) {
- console.log(is_company)
- if (is_company) {
- // 跳转到企业认证完成信息展示页面
- this.$router.push({
- name: ''
- })
- } else {
+ // 是否展示企业信息 企业认证 -1.未认证,0.审核中,1.审核通过,2.驳回
+ company(code) {
+ console.log(code, '是否企业认证')
+ if (code === -1) {
// 跳转到企业认证页面
- this.$router.push({
- name: ''
+ uni.navigateTo({
+ url: '/pages/company/approve'
+ })
+ } else if (code === 2) {
+ // 跳转到企业认证页面
+ uni.navigateTo({
+ url: '/pages/company/approve?form_type=put'
+ })
+ } else if (code === 0) {
+ this.$refs.uToast.show({
+ title: '审核中',
+ type: 'primary',
+ duration: 3000
+ })
+ } else if (code === 1) {
+ // 跳转到企业认证页面
+ this.$refs.uToast.show({
+ title: '认证通过!',
+ type: 'primary',
+ duration: 3000
})
}
},
@@ -148,8 +178,7 @@
this.avatar.showPath = res.avatar
this.nickname = res.nickname
this.is_bind = res.is_bind
- this.is_certification = res.is_certification
- this.is_company = res.is_company
+ this.certification = res.certification
uni.stopPullDownRefresh()
}).catch(err => {
this.$refs.uToast.show({
@@ -158,6 +187,17 @@
duration: 3000
})
})
+ // -1.未认证,0.审核中,1.审核通过,2.驳回
+ companyStatus().then(res => {
+ console.log(res)
+ this.companyCode = res
+ }).catch(err => {
+ this.$refs.uToast.show({
+ title: err.message,
+ type: 'primary',
+ duration: 3000
+ })
+ })
},
// 点击绑定用户得授权信息,且绑定带修改
getUser() {
@@ -385,8 +425,9 @@
flex: 1;
input {
- padding-right: 30rpx;
+ padding-right: 20rpx;
width: 100%;
+ font-size: 30rpx;
}
}
diff --git a/pages/shop/create.vue b/pages/shop/create.vue
new file mode 100644
index 0000000..2208e6d
--- /dev/null
+++ b/pages/shop/create.vue
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+ {{startTime || '选择开店时间'}}
+
+
+
+
+
+
+
+
+ {{endTime || '选择闭店时间'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/shop/lists.vue b/pages/shop/lists.vue
new file mode 100644
index 0000000..ff1ec03
--- /dev/null
+++ b/pages/shop/lists.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
+ 店铺地址:{{item.address}}
+
+
+
+
+
+ 暂未创建店铺/部门
+ 创建
+
+
+
+
+
+
+
+
diff --git a/pages/user/index.vue b/pages/user/index.vue
index befaee9..ed83710 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -127,7 +127,7 @@
当前能量球价值¥0.00
-
+
去提现
@@ -136,12 +136,12 @@
我的资产
-
- 能量球钱包
+
+ 能量球钱包
{{userData.account.coins || 0}}
-
- 能量碎片
+
+ 能量碎片
{{userData.account.score || 0}}
@@ -183,7 +183,7 @@
优惠券管理
-
+
营销推广码
@@ -191,14 +191,18 @@
基础信息
-
+
部门门店
-
+
员工管理
+
diff --git a/pages/verification/history.vue b/pages/verification/history.vue
index 6bb1dc4..55f1c32 100644
--- a/pages/verification/history.vue
+++ b/pages/verification/history.vue
@@ -270,7 +270,7 @@
width: calc(100% - 60rpx);
height: 360rpx;
background-image: linear-gradient(to left, #076cff, #076cff);
- box-shadow: 0 10rpx 20rpx 0rpx rgba($color: $main-color, $alpha: 0.4);
+ box-shadow: 0 10rpx 20rpx 0rpx rgba($color: $mian-color, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
diff --git a/pages/wallet/add.vue b/pages/wallet/add.vue
new file mode 100644
index 0000000..d0522c7
--- /dev/null
+++ b/pages/wallet/add.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+ 激活您的OC Chain区块链钱包地址。地址可以理解为您的个人银行卡卡号,与他人转账时是区块链上两个地址的交易行为
+
+ 激活钱包
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/cmsWithDraw.vue b/pages/wallet/cmsWithDraw.vue
new file mode 100644
index 0000000..5476ab1
--- /dev/null
+++ b/pages/wallet/cmsWithDraw.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/code.vue b/pages/wallet/code.vue
new file mode 100644
index 0000000..3adee0c
--- /dev/null
+++ b/pages/wallet/code.vue
@@ -0,0 +1,136 @@
+
+
+
+ 扫码转入OC COIN
+
+
+
+
+ 钱包地址
+ {{address || '-'}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/create.vue b/pages/wallet/create.vue
new file mode 100644
index 0000000..2d7a1ad
--- /dev/null
+++ b/pages/wallet/create.vue
@@ -0,0 +1,138 @@
+
+
+
+
+ 请设置6位数字密码。建议不要使用连续的数字。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/extract.vue b/pages/wallet/extract.vue
new file mode 100644
index 0000000..bf4858d
--- /dev/null
+++ b/pages/wallet/extract.vue
@@ -0,0 +1,393 @@
+
+
+
+ 能量球提现至银行卡
+
+
+
+ ≈ ¥{{total}}
+
+ 全部提现
+
+
+
+
+
+
+
+
+
+ 能量球总数 : {{balance}}总估值(CNY)≈¥{{(balance*price).toFixed(2)}}
+
+
+ 提现至银行卡
+
+
+
+ 回执单号:{{item.receipt_code}}
+
+
+
+ 能量球:{{item.total}}
+ 金额≈¥{{item.arrival}}
+
+
+ {{item.created_at}} 提现
+ {{item.paid_at?item.paid_at+'到账':'努力打款中'}}
+
+
+
+
+ {{has_more?'努力加载中~':'我是有底线的~'}}
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/fragment.vue b/pages/wallet/fragment.vue
new file mode 100644
index 0000000..60857ee
--- /dev/null
+++ b/pages/wallet/fragment.vue
@@ -0,0 +1,338 @@
+
+
+
+
+
+ 年账单
+ 月账单
+ 日账单
+
+
+
+ 碎片个数
+ {{account || '0.00'}} 个
+
+
+
+
+ {{date?date:'选择日期'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 完成任务获得碎片
+ {{cointype==='in'?'+':'-'}}5
+
+ 2021-12-22 12:12:12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/guide.vue b/pages/wallet/guide.vue
new file mode 100644
index 0000000..04170d9
--- /dev/null
+++ b/pages/wallet/guide.vue
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/index.vue b/pages/wallet/index.vue
new file mode 100644
index 0000000..dee4676
--- /dev/null
+++ b/pages/wallet/index.vue
@@ -0,0 +1,144 @@
+
+
+
+
+ 总资产(元)
+ 0.00
+
+
+
+
+
+
+
+ OC COIN
+ ≈¥0.21
+
+
+ 120,330.00
+ ¥25269.3000
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/mnemonic.vue b/pages/wallet/mnemonic.vue
new file mode 100644
index 0000000..41e18a9
--- /dev/null
+++ b/pages/wallet/mnemonic.vue
@@ -0,0 +1,108 @@
+
+
+
+
+ 请按照顺序记录并确保正确备份助记词
+
+
+
+
+
+ 注:助记词是用户账户的唯一标识,不能分享给他人,掌握该助记词即可控制该账户与钱包
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/privatekey.vue b/pages/wallet/privatekey.vue
new file mode 100644
index 0000000..0cd040c
--- /dev/null
+++ b/pages/wallet/privatekey.vue
@@ -0,0 +1,108 @@
+
+
+
+
+ 您已接收OC Chain托管
+ {{key || '-'}}
+ 复制我的私钥
+
+
+
+
+ {{item.title || '-'}}
+ {{item.description || '-'}}
+
+
+
+
+ 免责条款
+
+
+
+
+
+
+
diff --git a/pages/wallet/property.vue b/pages/wallet/property.vue
new file mode 100644
index 0000000..f732923
--- /dev/null
+++ b/pages/wallet/property.vue
@@ -0,0 +1,357 @@
+
+
+
+
+
+ 能量球 (≈ {{ price || '0' }} CNY)
+ {{ balance.balance || '0' }}
+ {{ balance.frozen || '0' }} 冻结中
+
+ 区块链地址
+
+ 能量球提现
+
+
+
+
+
+
+ 全部
+ 收入
+ 支出
+
+
+
+
+
+
+
+
+
+ 验证密码
+
+
+
+ 取消
+ 验证
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/resetPassword.vue b/pages/wallet/resetPassword.vue
new file mode 100644
index 0000000..c054f91
--- /dev/null
+++ b/pages/wallet/resetPassword.vue
@@ -0,0 +1,150 @@
+
+
+
+
+ 请设置6位数字密码。建议不要使用连续的数字。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/results.vue b/pages/wallet/results.vue
new file mode 100644
index 0000000..2e2718c
--- /dev/null
+++ b/pages/wallet/results.vue
@@ -0,0 +1,77 @@
+
+
+
+
+ 交易已提交
+ 预计10秒内到账,可在交易记录中查询,以实际到账时间为准
+
+ 交易哈希
+ {{hash}}
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/transfer.vue b/pages/wallet/transfer.vue
new file mode 100644
index 0000000..e66843c
--- /dev/null
+++ b/pages/wallet/transfer.vue
@@ -0,0 +1,216 @@
+
+
+
+
+ OCC
+
+
+ {{balance.balance || '0.00'}}
+
+
+ ≈{{cny || '0.00'}}
+
+
+
+
+ 请认真确认地址及数量,地址错误无法找回
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/wallet/validation.vue b/pages/wallet/validation.vue
new file mode 100644
index 0000000..e28cb42
--- /dev/null
+++ b/pages/wallet/validation.vue
@@ -0,0 +1,169 @@
+
+
+
+
+ 验证您的钱包助记词
+
+
+
+ {{ item }}
+
+
+
+
+ 按顺序填写助记词
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scss/globa.scss b/scss/globa.scss
index f63b05f..77e16da 100644
--- a/scss/globa.scss
+++ b/scss/globa.scss
@@ -10,9 +10,12 @@ $text-color: #333;
$text-gray: #555;
$text-gray-m: #999;
$text-price: #8b64fd;
-$mian-color: #b11eff;
+$mian-color: #8b64fd;
$mian-color-deep: #824f9a;
+// 矿机
+$block-color: #2b2449;
+
// 边框颜色
$border-color: #ddd;
$border-color-lg: #eff4f2;
@@ -76,20 +79,6 @@ $padding: 30rpx;
-webkit-line-clamp: 2;
}
-.ellipsis {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-}
-
-.ellipsis-2 {
- display: -webkit-box;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
-}
-
.ellipsis-3 {
display: -webkit-box;
overflow: hidden;
diff --git a/static/background/chain-back-00.png b/static/background/chain-back-00.png
index b314449..abfae9e 100644
Binary files a/static/background/chain-back-00.png and b/static/background/chain-back-00.png differ
diff --git a/static/background/chain-back-02.png b/static/background/chain-back-02.png
index ba604f4..a0f77b9 100644
Binary files a/static/background/chain-back-02.png and b/static/background/chain-back-02.png differ
diff --git a/static/icons/crystal-icon.png b/static/icons/crystal-icon.png
index 4c1ab9c..bd90359 100644
Binary files a/static/icons/crystal-icon.png and b/static/icons/crystal-icon.png differ
diff --git a/static/icons/gemstone-icon.png b/static/icons/gemstone-icon.png
index 39db38f..50cf9b0 100644
Binary files a/static/icons/gemstone-icon.png and b/static/icons/gemstone-icon.png differ
diff --git a/static/icons/gemstone-ore-icon.png b/static/icons/gemstone-ore-icon.png
new file mode 100644
index 0000000..39439bc
Binary files /dev/null and b/static/icons/gemstone-ore-icon.png differ
diff --git a/static/icons/logs-null.png b/static/icons/logs-null.png
new file mode 100644
index 0000000..eda2c10
Binary files /dev/null and b/static/icons/logs-null.png differ
diff --git a/static/imgs/account-bg.png b/static/imgs/account-bg.png
new file mode 100644
index 0000000..166699c
Binary files /dev/null and b/static/imgs/account-bg.png differ
diff --git a/static/imgs/cart_empty.png b/static/imgs/cart_empty.png
new file mode 100644
index 0000000..64d64c8
Binary files /dev/null and b/static/imgs/cart_empty.png differ
diff --git a/static/imgs/news_1.png b/static/imgs/news_1.png
new file mode 100644
index 0000000..4838c92
Binary files /dev/null and b/static/imgs/news_1.png differ
diff --git a/static/imgs/news_2.png b/static/imgs/news_2.png
new file mode 100644
index 0000000..dd19454
Binary files /dev/null and b/static/imgs/news_2.png differ
diff --git a/static/imgs/news_2_1.png b/static/imgs/news_2_1.png
new file mode 100644
index 0000000..1d12137
Binary files /dev/null and b/static/imgs/news_2_1.png differ
diff --git a/static/imgs/news_3.png b/static/imgs/news_3.png
new file mode 100644
index 0000000..87ab761
Binary files /dev/null and b/static/imgs/news_3.png differ
diff --git a/static/imgs/news_3_1.png b/static/imgs/news_3_1.png
new file mode 100644
index 0000000..a4065ce
Binary files /dev/null and b/static/imgs/news_3_1.png differ
diff --git a/static/imgs/record-icon.png b/static/imgs/record-icon.png
new file mode 100644
index 0000000..9464afb
Binary files /dev/null and b/static/imgs/record-icon.png differ
diff --git a/uni_modules/uni-collapse/changelog.md b/uni_modules/uni-collapse/changelog.md
new file mode 100644
index 0000000..c0dba72
--- /dev/null
+++ b/uni_modules/uni-collapse/changelog.md
@@ -0,0 +1,27 @@
+## 1.3.3(2021-08-17)
+- 优化 show-arrow 属性默认为true
+## 1.3.2(2021-08-17)
+- 新增 show-arrow 属性,控制是否显示右侧箭头
+## 1.3.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.3.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.2.2(2021-07-21)
+- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
+## 1.2.1(2021-07-21)
+- 优化 组件示例
+## 1.2.0(2021-07-21)
+- 新增 组件折叠动画
+- 新增 value\v-model 属性 ,动态修改面板折叠状态
+- 新增 title 插槽 ,可定义面板标题
+- 新增 border 属性 ,显示隐藏面板内容分隔线
+- 新增 title-border 属性 ,显示隐藏面板标题分隔线
+- 修复 resize 方法失效的Bug
+- 修复 change 事件返回参数不正确的Bug
+- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.1.5(2021-02-05)
+- 调整为uni_modules目录规范
\ No newline at end of file
diff --git a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
new file mode 100644
index 0000000..32d6373
--- /dev/null
+++ b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
@@ -0,0 +1,402 @@
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue b/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
new file mode 100644
index 0000000..f16d8fa
--- /dev/null
+++ b/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-collapse/package.json b/uni_modules/uni-collapse/package.json
new file mode 100644
index 0000000..59731d5
--- /dev/null
+++ b/uni_modules/uni-collapse/package.json
@@ -0,0 +1,88 @@
+{
+ "id": "uni-collapse",
+ "displayName": "uni-collapse 折叠面板",
+ "version": "1.3.3",
+ "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
+ "keywords": [
+ "uni-ui",
+ "折叠",
+ "折叠面板",
+ "手风琴"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-collapse/readme.md b/uni_modules/uni-collapse/readme.md
new file mode 100644
index 0000000..12e872f
--- /dev/null
+++ b/uni_modules/uni-collapse/readme.md
@@ -0,0 +1,276 @@
+
+
+## Collapse 折叠面板
+> **组件名:uni-collapse**
+> 代码块: `uCollapse`
+> 关联组件:`uni-collapse-item`、`uni-icons`。
+
+
+折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。
+
+> **注意事项**
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 组件需要依赖 `sass` 插件 ,请自行手动安装
+> - `App` 端默认关闭组件动画 ,因为 `height` 动画开销比较大,会导致页面卡顿,请酌情使用动画
+> - 如在使用组件过程从发现卡顿严重,请尝试停用组件动画,问题原因如上
+> - 在小程序端组件内容发生变化,需要手动调用 resize() 方法,手动更新几点信息,避免出现内容错位
+> - 如需自定义组件默认边框颜色等,请使用插槽自定义内容并合理使用 `border ` 和 `title-border` 属性
+> - 折叠面板仅支持嵌套使用,请勿单独使用
+> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"`
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+
+### 基本用法
+
+使用 `title` 属性指定面板显示内容
+
+使用 `open` 属性默认打开当前面板
+
+使用 `disabled` 属性禁用面板
+
+
+```html
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+```
+
+### 手风琴效果
+
+使用 `accordion` 属性,可以仅打开一个面板并关闭其他已经打开的面板,效果类似手风琴
+
+设置 `accordion` 属性时,`open` 属性则生效在最后一个组件
+
+```html
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+```
+
+### 动态设置折叠面板打开状态
+
+使用 `v-model` 属性,动态设置面板的显示状态
+
+使用 `name` 属性设置每个面板的唯一标识,如不设置使用默认索引,从字符串 `"0"` 开始记数
+
+**注意**
+
+- 如果 `accordion` 属性为 `true` 则 `v-model` 类型为 `String`
+- 如果 `accordion` 属性为 `false` 则 `v-model` 类型为 `Array`
+- 请注意 `v-model` 属性与 `open` 属性请勿一起使用 ,建议只使用 `v-model`
+
+```html
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+```
+
+```javascript
+export default {
+ data(){
+ return {
+ value:['key1','key2'],
+ // 如果设置了 accordion 属性,则使用 string 类型
+ // value:'key1'
+ }
+ }
+}
+```
+
+### 使用动画
+
+使用 `show-animation` 属性开启或关闭面板折叠动画,默认动画开启
+
+**注意**
+
+- `App` 端默认关闭组件动画 ,因为 height 动画开销比较大,会导致页面卡顿,请酌情使用动画,如出现明显卡顿,尝试关闭动画
+
+
+```html
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+ 折叠内容
+
+
+```
+
+### 配置图片
+
+使用 `thumb` 配置图片地址, 可在面板左侧显示一个图片
+
+如需显示更多内容,如图标等,请见下方自定义插槽的说明
+
+```html
+
+
+
+ 折叠内容主体,可自定义内容及样式
+
+
+
+```
+
+### 自定义插槽
+
+如果需要自定义面板显示,可以使用 `title` 插槽达成完全自定义。下面是一个使用 `uni-list` 的列表示例,需要引入 `uni-list` 组件
+
+```html
+
+
+
+
+
+
+
+
+
+
+ 折叠内容主体,可自定义内容及样式
+
+
+
+```
+
+**注意**
+
+- 在折叠面板组件中使用list时,在 App-Nvue 下请勿单独使用 uni-list-item,会导致组件无法正常显示,其他平台不做限制
+- 在默认插槽里使用 uni-list 组件与上方示例一样,直接写在默认插槽里即可
+
+## API
+
+### Collapse Props
+
+|属性名|类型|默认值|说明|
+|:-:|:-:|:-:|:-:|
+|value/v-model|String/Array|-|当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)|
+|accordion|Boolean|false|是否开启手风琴效果 |
+
+### Collapse Event
+
+|事件称名|说明|返回值|
+|:-:|:-:|:-:|
+|@change|切换面板时触发 |切换面板时触发,如果是手风琴模式,返回类型为string,否则为array|
+
+### Collapse Methods
+
+|方法名称|说明|
+|:-:|:-:|
+|resize |更新当前列表高度|
+
+> **提示**
+> - resize 方法解决动态添加数据,带动画的折叠面板高度不更新的问题
+> - 需要在数据渲染完毕之后使用 `resize` 方法。推荐在 `this.$nextTick()` 中使用
+> - 当前只有小程序端需要调用此方法,H5\App 端已经做了处理,不需要手动更新高度
+> ```html
+>
+>
+>
+>
+> {{content}}
+>
+>
+>
+>
+> 折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。
+>
+>
+>
+>
+>
+> ```
+> ```javascript
+> export default {
+> data() {
+> return {
+> value:['0'],
+> content: '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。',
+> }
+> },
+> methods: {
+> add() {
+> if (this.content.length > 35) {
+> this.content = '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。'
+> } else {
+> this.content = '折叠内容主体,这是一段比较长内容。通过点击按钮修改后内容后,使组件高度发生变化,在次点击按钮恢复之前的内容和高度。'
+> }
+> // TODO 小程序中不支持自动更新 ,需要手动resize 更新组件高度
+> // #ifdef MP
+> this.$nextTick(() => {
+> this.$refs.collapse.resize()
+> })
+> // #endif
+> }
+> }
+> }
+> ```
+
+
+### CollapseItem Props
+
+|属性名|类型|默认值|说明|
+|:-:|:-:|:-:|:-:|
+|title|String|-|标题文字|
+|thumb|String|-|标题左侧缩略图|
+|disabled|Boolean|false|是否禁用|
+|open|Boolean|false|是否展开面板|
+|show-animation|Boolean|false|开启动画|
+|border|Boolean|true|折叠面板内容分隔线|
+|title-border|String|auto|折叠面板标题分隔线可选值见下方 **TitleBorder Params**|
+|show-arrow|Boolean|true|是否显示右侧箭头|
+
+#### TitleBorder Params
+
+|参数名|说明|
+|:-:|:-:|
+|auto|分隔线自动显示|
+|none|不显示分隔线|
+|show|一直显示分隔线|
+
+### Collapse Slots
+
+|插槽名|说明|
+|:-:| :-:|
+|default|默认插槽|
+|title|面板标题插槽,如使用此插槽禁用样式效果将失效|
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse](https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse)
\ No newline at end of file
diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js
index 60b7332..5242f22 100644
--- a/uni_modules/uni-icons/components/uni-icons/icons.js
+++ b/uni_modules/uni-icons/components/uni-icons/icons.js
@@ -1,132 +1,132 @@
-export default {
- "pulldown": "\ue588",
- "refreshempty": "\ue461",
- "back": "\ue471",
- "forward": "\ue470",
- "more": "\ue507",
- "more-filled": "\ue537",
- "scan": "\ue612",
- "qq": "\ue264",
- "weibo": "\ue260",
- "weixin": "\ue261",
- "pengyouquan": "\ue262",
- "loop": "\ue565",
- "refresh": "\ue407",
- "refresh-filled": "\ue437",
- "arrowthindown": "\ue585",
- "arrowthinleft": "\ue586",
- "arrowthinright": "\ue587",
- "arrowthinup": "\ue584",
- "undo-filled": "\ue7d6",
- "undo": "\ue406",
- "redo": "\ue405",
- "redo-filled": "\ue7d9",
- "bars": "\ue563",
- "chatboxes": "\ue203",
- "camera": "\ue301",
- "chatboxes-filled": "\ue233",
- "camera-filled": "\ue7ef",
- "cart-filled": "\ue7f4",
- "cart": "\ue7f5",
- "checkbox-filled": "\ue442",
- "checkbox": "\ue7fa",
- "arrowleft": "\ue582",
- "arrowdown": "\ue581",
- "arrowright": "\ue583",
- "smallcircle-filled": "\ue801",
- "arrowup": "\ue580",
- "circle": "\ue411",
- "eye-filled": "\ue568",
- "eye-slash-filled": "\ue822",
- "eye-slash": "\ue823",
- "eye": "\ue824",
- "flag-filled": "\ue825",
- "flag": "\ue508",
- "gear-filled": "\ue532",
- "reload": "\ue462",
- "gear": "\ue502",
- "hand-thumbsdown-filled": "\ue83b",
- "hand-thumbsdown": "\ue83c",
- "hand-thumbsup-filled": "\ue83d",
- "heart-filled": "\ue83e",
- "hand-thumbsup": "\ue83f",
- "heart": "\ue840",
- "home": "\ue500",
- "info": "\ue504",
- "home-filled": "\ue530",
- "info-filled": "\ue534",
- "circle-filled": "\ue441",
- "chat-filled": "\ue847",
- "chat": "\ue263",
- "mail-open-filled": "\ue84d",
- "email-filled": "\ue231",
- "mail-open": "\ue84e",
- "email": "\ue201",
- "checkmarkempty": "\ue472",
- "list": "\ue562",
- "locked-filled": "\ue856",
- "locked": "\ue506",
- "map-filled": "\ue85c",
- "map-pin": "\ue85e",
- "map-pin-ellipse": "\ue864",
- "map": "\ue364",
- "minus-filled": "\ue440",
- "mic-filled": "\ue332",
- "minus": "\ue410",
- "micoff": "\ue360",
- "mic": "\ue302",
- "clear": "\ue434",
- "smallcircle": "\ue868",
- "close": "\ue404",
- "closeempty": "\ue460",
- "paperclip": "\ue567",
- "paperplane": "\ue503",
- "paperplane-filled": "\ue86e",
- "person-filled": "\ue131",
- "contact-filled": "\ue130",
- "person": "\ue101",
- "contact": "\ue100",
- "images-filled": "\ue87a",
- "phone": "\ue200",
- "images": "\ue87b",
- "image": "\ue363",
- "image-filled": "\ue877",
- "location-filled": "\ue333",
- "location": "\ue303",
- "plus-filled": "\ue439",
- "plus": "\ue409",
- "plusempty": "\ue468",
- "help-filled": "\ue535",
- "help": "\ue505",
- "navigate-filled": "\ue884",
- "navigate": "\ue501",
- "mic-slash-filled": "\ue892",
- "search": "\ue466",
- "settings": "\ue560",
- "sound": "\ue590",
- "sound-filled": "\ue8a1",
- "spinner-cycle": "\ue465",
- "download-filled": "\ue8a4",
- "personadd-filled": "\ue132",
- "videocam-filled": "\ue8af",
- "personadd": "\ue102",
- "upload": "\ue402",
- "upload-filled": "\ue8b1",
- "starhalf": "\ue463",
- "star-filled": "\ue438",
- "star": "\ue408",
- "trash": "\ue401",
- "phone-filled": "\ue230",
- "compose": "\ue400",
- "videocam": "\ue300",
- "trash-filled": "\ue8dc",
- "download": "\ue403",
- "chatbubble-filled": "\ue232",
- "chatbubble": "\ue202",
- "cloud-download": "\ue8e4",
- "cloud-upload-filled": "\ue8e5",
- "cloud-upload": "\ue8e6",
+export default {
+ "pulldown": "\ue588",
+ "refreshempty": "\ue461",
+ "back": "\ue471",
+ "forward": "\ue470",
+ "more": "\ue507",
+ "more-filled": "\ue537",
+ "scan": "\ue612",
+ "qq": "\ue264",
+ "weibo": "\ue260",
+ "weixin": "\ue261",
+ "pengyouquan": "\ue262",
+ "loop": "\ue565",
+ "refresh": "\ue407",
+ "refresh-filled": "\ue437",
+ "arrowthindown": "\ue585",
+ "arrowthinleft": "\ue586",
+ "arrowthinright": "\ue587",
+ "arrowthinup": "\ue584",
+ "undo-filled": "\ue7d6",
+ "undo": "\ue406",
+ "redo": "\ue405",
+ "redo-filled": "\ue7d9",
+ "bars": "\ue563",
+ "chatboxes": "\ue203",
+ "camera": "\ue301",
+ "chatboxes-filled": "\ue233",
+ "camera-filled": "\ue7ef",
+ "cart-filled": "\ue7f4",
+ "cart": "\ue7f5",
+ "checkbox-filled": "\ue442",
+ "checkbox": "\ue7fa",
+ "arrowleft": "\ue582",
+ "arrowdown": "\ue581",
+ "arrowright": "\ue583",
+ "smallcircle-filled": "\ue801",
+ "arrowup": "\ue580",
+ "circle": "\ue411",
+ "eye-filled": "\ue568",
+ "eye-slash-filled": "\ue822",
+ "eye-slash": "\ue823",
+ "eye": "\ue824",
+ "flag-filled": "\ue825",
+ "flag": "\ue508",
+ "gear-filled": "\ue532",
+ "reload": "\ue462",
+ "gear": "\ue502",
+ "hand-thumbsdown-filled": "\ue83b",
+ "hand-thumbsdown": "\ue83c",
+ "hand-thumbsup-filled": "\ue83d",
+ "heart-filled": "\ue83e",
+ "hand-thumbsup": "\ue83f",
+ "heart": "\ue840",
+ "home": "\ue500",
+ "info": "\ue504",
+ "home-filled": "\ue530",
+ "info-filled": "\ue534",
+ "circle-filled": "\ue441",
+ "chat-filled": "\ue847",
+ "chat": "\ue263",
+ "mail-open-filled": "\ue84d",
+ "email-filled": "\ue231",
+ "mail-open": "\ue84e",
+ "email": "\ue201",
+ "checkmarkempty": "\ue472",
+ "list": "\ue562",
+ "locked-filled": "\ue856",
+ "locked": "\ue506",
+ "map-filled": "\ue85c",
+ "map-pin": "\ue85e",
+ "map-pin-ellipse": "\ue864",
+ "map": "\ue364",
+ "minus-filled": "\ue440",
+ "mic-filled": "\ue332",
+ "minus": "\ue410",
+ "micoff": "\ue360",
+ "mic": "\ue302",
+ "clear": "\ue434",
+ "smallcircle": "\ue868",
+ "close": "\ue404",
+ "closeempty": "\ue460",
+ "paperclip": "\ue567",
+ "paperplane": "\ue503",
+ "paperplane-filled": "\ue86e",
+ "person-filled": "\ue131",
+ "contact-filled": "\ue130",
+ "person": "\ue101",
+ "contact": "\ue100",
+ "images-filled": "\ue87a",
+ "phone": "\ue200",
+ "images": "\ue87b",
+ "image": "\ue363",
+ "image-filled": "\ue877",
+ "location-filled": "\ue333",
+ "location": "\ue303",
+ "plus-filled": "\ue439",
+ "plus": "\ue409",
+ "plusempty": "\ue468",
+ "help-filled": "\ue535",
+ "help": "\ue505",
+ "navigate-filled": "\ue884",
+ "navigate": "\ue501",
+ "mic-slash-filled": "\ue892",
+ "search": "\ue466",
+ "settings": "\ue560",
+ "sound": "\ue590",
+ "sound-filled": "\ue8a1",
+ "spinner-cycle": "\ue465",
+ "download-filled": "\ue8a4",
+ "personadd-filled": "\ue132",
+ "videocam-filled": "\ue8af",
+ "personadd": "\ue102",
+ "upload": "\ue402",
+ "upload-filled": "\ue8b1",
+ "starhalf": "\ue463",
+ "star-filled": "\ue438",
+ "star": "\ue408",
+ "trash": "\ue401",
+ "phone-filled": "\ue230",
+ "compose": "\ue400",
+ "videocam": "\ue300",
+ "trash-filled": "\ue8dc",
+ "download": "\ue403",
+ "chatbubble-filled": "\ue232",
+ "chatbubble": "\ue202",
+ "cloud-download": "\ue8e4",
+ "cloud-upload-filled": "\ue8e5",
+ "cloud-upload": "\ue8e6",
"cloud-download-filled": "\ue8e9",
"headphones":"\ue8bf",
- "shop":"\ue609"
+ "shop":"\ue609"
}
diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
index 6bcc0a2..edd5f08 100644
--- a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
+++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
@@ -1,72 +1,72 @@
-
- {{fontFamily ? '' : icons[type]}}
-
-
-
-
-
diff --git a/uni_modules/uni-swipe-action/changelog.md b/uni_modules/uni-swipe-action/changelog.md
new file mode 100644
index 0000000..b3bc0be
--- /dev/null
+++ b/uni_modules/uni-swipe-action/changelog.md
@@ -0,0 +1,24 @@
+## 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
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js
new file mode 100644
index 0000000..7fcf9ea
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js
@@ -0,0 +1,300 @@
+// #ifdef APP-NVUE
+const BindingX = uni.requireNativePlugin('bindingx');
+const dom = uni.requireNativePlugin('dom');
+const animation = uni.requireNativePlugin('animation');
+
+export default {
+ 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.children !== undefined) {
+ 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) {
+ // 每次只触发一次,避免多次监听造成闪烁
+ if (this.stop) return
+ this.stop = true
+ if (this.autoClose) {
+ 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
+
+// #ifndef APP-NVUE
+export default {}
+// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js
new file mode 100644
index 0000000..7f549f6
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js
@@ -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;
+}
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js
new file mode 100644
index 0000000..ad737ce
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js
@@ -0,0 +1,193 @@
+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.children !== undefined) {
+ 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
+ this.autoClose && 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();
+
+ }
+ }
+}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js
new file mode 100644
index 0000000..eef2233
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js
@@ -0,0 +1,258 @@
+// #ifndef APP-PLUS|| MP-WEIXIN || H5
+
+const MIN_DISTANCE = 10;
+export default {
+ 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.children !== undefined) {
+ 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) return
+ 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
+
+// #ifdef APP-PLUS|| MP-WEIXIN || H5
+export default { }
+// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js
new file mode 100644
index 0000000..1e36fd5
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js
@@ -0,0 +1,81 @@
+// #ifdef APP-VUE|| MP-WEIXIN || H5
+import { isPC } from "./isPC"
+export default {
+ data() {
+ return {
+ is_show:'none'
+ }
+ },
+ watch: {
+ show(newVal){
+ this.is_show = this.show
+ }
+ },
+ created() {
+ this.swipeaction = this.getSwipeAction()
+ if (this.swipeaction.children !== undefined) {
+ this.swipeaction.children.push(this)
+ }
+ },
+ mounted(){
+ this.is_show = this.show
+ },
+ methods: {
+ // wxs 中调用
+ closeSwipe(e) {
+ if (!this.autoClose) return
+ this.swipeaction.closeOther(this)
+ },
+
+ change(e) {
+ this.$emit('change', e.open)
+ if (this.is_show !== e.open) {
+ this.is_show = e.open
+ }
+ },
+
+ appTouchStart(e) {
+ // #ifdef H5
+ if(isPC()) return
+ // #endif
+ const {
+ clientX
+ } = e.changedTouches[0]
+ this.clientX = clientX
+ this.timestamp = new Date().getTime()
+ },
+ appTouchEnd(e, index, item, position) {
+ // #ifdef H5
+ if(isPC()) return
+ // #endif
+ 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) {
+ // #ifdef H5
+ if(!isPC()) return
+ this.$emit('click', {
+ content: item,
+ index,
+ position
+ })
+ // #endif
+ }
+ }
+}
+
+// #endif
+// #ifndef APP-VUE|| MP-WEIXIN || H5
+export default {}
+// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js
new file mode 100644
index 0000000..ac50d75
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js
@@ -0,0 +1,265 @@
+const MIN_DISTANCE = 10;
+export default {
+ showWatch(newVal, oldVal, ownerInstance, instance,self) {
+ let state = self.state
+ 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;
+ 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) {
+ let state = self.state
+ var leftDom = ownerInstance.$el.querySelector('.button-group--left')
+ var rightDom = ownerInstance.$el.querySelector('.button-group--right')
+
+ state.leftWidth = leftDom.offsetWidth || 0
+ state.rightWidth = rightDom.offsetWidth || 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);
+ }
+}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
new file mode 100644
index 0000000..310c5e7
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
@@ -0,0 +1,348 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
new file mode 100644
index 0000000..6806032
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
@@ -0,0 +1,341 @@
+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
+ }
+ leftStyles = leftDom.getBoundingClientRect()
+ 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;
+ }
+ }
+ 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
+}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
new file mode 100644
index 0000000..87e5572
--- /dev/null
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-swipe-action/package.json b/uni_modules/uni-swipe-action/package.json
new file mode 100644
index 0000000..a69be52
--- /dev/null
+++ b/uni_modules/uni-swipe-action/package.json
@@ -0,0 +1,87 @@
+{
+ "id": "uni-swipe-action",
+ "displayName": "uni-swipe-action 滑动操作",
+ "version": "1.2.4",
+ "description": "SwipeAction 滑动操作操作组件",
+ "keywords": [
+ "",
+ "uni-ui",
+ "uniui",
+ "滑动删除",
+ "侧滑删除"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "y",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/readme.md b/uni_modules/uni-swipe-action/readme.md
new file mode 100644
index 0000000..3afcd26
--- /dev/null
+++ b/uni_modules/uni-swipe-action/readme.md
@@ -0,0 +1,193 @@
+
+
+## SwipeAction 滑动操作
+> **组件名:uni-swipe-action**
+> 代码块: `uSwipeAction`、`uSwipeActionItem`
+
+
+通过滑动触发选项的容器
+
+> **注意事项**
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - swipeAction的跟手联动是非常考验性能的。为了提高交互体验,本组件在 app 端 vue 页面、h5、微信小程序使用了wxs 技术,nvue 页面使用 bindingx 技术,可以达到流畅的体验。在其他小程序平台由于底层不支持优化技术,只能使用使用普通 js ,此时性能一般。
+> - `uni-swipe-action` 和 `uni-swipe-action-item` 需要同时使用
+> - `uni-swipe-action` 不能嵌套在 `swiper` 中使用
+> - 长列表不建议使用 autoClose属性,会影响组件性能,造成卡顿,原因是打开之后要通知其他已经打开的组件关闭,会导致多个组件重新渲染
+> - 事件中传入 `$event` 获取额外参数
+> - 向下兼容,需要将 `options` 属性替换成 `right-options`
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+
+## 基本用法
+
+在 ``template`` 中的使用
+
+```html
+
+
+
+ SwipeAction 基础使用场景
+
+
+
+
+ 置顶
+
+
+ 使用插槽
+
+
+ 删除
+
+
+
+
+
+ 置顶
+
+ 混合使用
+
+
+
+
+
+
+ SwipeAction 基础使用场景
+
+
+
+
+
+
+ item1
+
+
+ item2
+
+
+ item3
+
+
+
+```
+
+
+```javascript
+export default {
+ data(){
+ return {
+ options:[
+ {
+ text: '取消',
+ style: {
+ backgroundColor: '#007aff'
+ }
+ }, {
+ text: '确认',
+ style: {
+ backgroundColor: '#dd524d'
+ }
+ }
+ ]
+ }
+ },
+ methods:{
+ onClick(e){
+ console.log('点击了'+(e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')
+ },
+ swipeChange(e,index){
+ console.log('当前状态:'+ e +',下标:' + index)
+ }
+ }
+}
+
+```
+
+## API
+
+### SwipeAciton Props
+
+|属性名|类型|可选值|默认值|是否必填|说明|
+|:-:|:-:|:-:|:-:|:-:|:-:|
+|show|String|left/right/none|none |否|开启关闭组件,auto-close = false 时生效|
+|threshold|Number|-|20|否|滑动阙值|
+|disabled|Boolean|-|false|否|是否禁止滑动|
+|autoClose|Boolean|-|true|否|其他组件开启的时候,当前组件是否自动关闭,**注意:长列表使用会有性能问题**|
+|left-options|Array/Object |-|-|否|左侧选项内容及样式|
+|right-options|Array/Object |-|-|否|右侧选项内容及样式|
+
+#### LeftOptions & RightOptions Options
+
+|参数|类型|是否必填 |说明|
+|:-:|:-:|:-:|:-:|
+|text|String|是|按钮的文字 |
+|style|Object|否|按钮样式{backgroundColor,color,fontSize},backgroundColor默认为:#C7C6CD,color默认为:#FFFFFF,fontSize默认为:14px |
+
+
+
+### SwipeAction Events
+
+|事件称名 |说明|返回值|
+|:-:|:-:|:-:|
+|@click|点击选项按钮时触发事件|e = {content,index} ,content(点击内容)、index(下标)、position (位置信息) |
+|@change|组件打开或关闭时触发|left:左侧 ,right:右侧,none:关闭|
+
+### SwipeAction Methods
+
+方法通过 ref 调用
+
+|方法称名 |说明|
+|:-:|:-:|
+|resize()|动态添加数据后,如不能正常滑动,需要主动调用此方法,微信小程序、h5、app-vue 不生效|
+|close-all()|关闭所有已经打开的组件|
+### SwipeAction Slots
+
+|名称|说明|
+|:-:|:-:|
+|-|默认插槽自定义显示内容|
+|default|默认内容插槽|
+|left|左侧滑动内容 ,会覆盖 leftOptions 内容|
+|right|右侧滑动内容 ,会覆盖 rightOptions 内容|
+
+> **提示**
+> - iOS 端由于存在bounce效果,滑动体验略差,建议禁止bounce效果,禁止方式如下:
+> ```javascript
+> {
+> "path": "swipe-action/swipe-action",
+> "style": {
+> "navigationBarTitleText": "SwipeAction 滑动操作",
+> "disableScroll":true,
+> "app-plus":{
+> "bounce":"none"
+> }
+> }
+> }
+> ```
+
+
+### Q&A
+1. Q:动态加载数据,组件滑动失效是怎么回事
+- A:是因为组件会在加载的时候获取相应的节点信息数据 ,获取需要滑动的距离,所以有时候动态加载数据之后,可能是时机的问题,导致节点信息获取失败 ,那么组件就不能正常滑动。
+- A:如果是在其他页面通过 vuex 或者uni.$emit 等手段来更新其他页面 uni-swipe-action 数据 ,同样会发生不能滑动的现象,原因是页面隐藏后是不能获取到页面信息的,所以回到 uni-swipe-action 页面后,新增的组件节点信息获取肯定是错误的,所以不能滑动。
+- A:值的高兴的是在 1.2.2 版本中重构了组件滑动逻辑 ,在微信小程序、h5、app-vue 中使用了 wxs 优化滑动性能,并且不需要担心动态新增组件导致组件无法滑动的问题,节点信息在滑动时实时获取。
+- A:因为其他平台无法使用 wxs ,所以还是会出现无法滑动的问题怎么处理?1.2.2 版本提供了 resize() 方法,无法滑动时调用 resize() 方法重新渲染组件即可,调用方法时要保证节点已经渲染完毕。
+
+2. Q:运行到 nvue 下没有样式
+- A:因为 nvue 下样式默认不能使用复杂的css选择器,所以需要在 manifest.json 中配置 "nvueStyleCompiler" 属性
+ ```json
+ // manifest.json
+ {
+ "nvueStyleCompiler" : "uni-app",
+ }
+ ```
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/swipe-action/swipe-action](https://hellouniapp.dcloud.net.cn/pages/extUI/swipe-action/swipe-action)
\ No newline at end of file