Blame view

src/components/uni-swipe-action/uni-swipe-action.vue 1.06 KB
61d825263   BigBoss   确认订单修改
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  <template>
  	<view>
  		<slot></slot>
  	</view>
  </template>
  
  <script>
  	/**
  	 * SwipeAction 滑动操作
  	 * @description 通过滑动触发选项的容器
  	 * @tutorial https://ext.dcloud.net.cn/plugin?id=181
  	 */
  	export default {
  		data() {
  			return {};
  		},
  		provide() {
  			return {
  				swipeaction: this
  			}
  		},
  		created() {
  			this.children = []
  		},
  		methods: {
  			closeOther(vm) {
  				let children = this.children
  				children.forEach((item, index) => {
  					if (vm === item) return
  					// 支付宝执行以下操作
  					// #ifdef MP-ALIPAY
  					if (item.isopen) {
  						item.close()
  					}
  					// #endif
  
  					// app vue 端、h5 、微信、支付宝  执行以下操作
  					// #ifdef APP-VUE || H5 || MP-WEIXIN
  					let position = item.position[0]
  					let show = position.show
  					if (show) {
  						position.show = false
  					}
  					// #endif
  
  					// nvue 执行以下操作
  					// #ifdef APP-NVUE || MP-BAIDU || MP-QQ || MP-TOUTIAO
  					item.close()
  					// #endif
  				})
  			}
  		}
  	}
  </script>
  
  <style>
  
  </style>