Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 2 years ago
parent
commit
1074efdb16
1 changed files with 32 additions and 18 deletions
  1. 32 18
      pages/business/record.vue

+ 32 - 18
pages/business/record.vue

@@ -53,6 +53,9 @@
 			<u-icon name="plus" color="#fff" size="34" bold></u-icon>
 		</view>
 		<u-toast ref="uToast" />
+		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
+			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
+			showCancelButton='false' content="确定删除当前记录?" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
 	</view>
 </template>
 
@@ -71,6 +74,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				selectObj: {},
+				isShowAlert: false,
 				canReset: false,
 				keyword: '',
 				inputStyle: {
@@ -127,6 +132,30 @@
 
 
 		methods: {
+			cancelClick() {
+				this.isShowAlert = false
+			},
+			alertBtn() {
+				let _obj = {
+					id: this.selectObj.id,
+				}
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				this.$api.doRequest('post', '/transactionExchangeInfo/deleteInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '删除成功',
+							type: 'success',
+						})
+						this.mescroll.resetUpScroll()
+					}
+					uni.hideLoading()
+				})
+			},
+
 			previewImage(item, index) {
 				console.log(111111111)
 				var i = item.imgList; //获取当前页面的轮播图数据
@@ -165,24 +194,9 @@
 				})
 			},
 			del(val) {
-				let _obj = {
-					id: val.id,
-				}
-				uni.showLoading({
-					title: '数据加载中',
-					mask: true
-				})
-				this.$api.doRequest('post', '/transactionExchangeInfo/deleteInfo', _obj).then(res => {
-					console.log(res.data)
-					if (res.data.code == 200) {
-						this.$refs.uToast.show({
-							title: '删除成功',
-							type: 'success',
-						})
-						this.mescroll.resetUpScroll()
-					}
-					uni.hideLoading()
-				})
+				this.selectObj = val
+				this.isShowAlert = true
+
 			},
 			selectAddress(val) {
 				console.log(val)