李天标 6 лет назад
Родитель
Сommit
e8021158a1
2 измененных файлов с 23 добавлено и 12 удалено
  1. 22 11
      pages/User/user.vue
  2. 1 1
      store/modules/chart.js

+ 22 - 11
pages/User/user.vue

@@ -24,7 +24,7 @@
 					<p id="p2" class="p2" :style="{display:showOrNo}">如:广东省广州市xx广场301型x号机</p>
 				</view>
 				<view class="">
-					<button type="primary" @click="updata()" class="button">
+					<button type="primary" @click="updata1()" class="button">
 						<p class="p">更改</p>
 					</button>
 				</view>
@@ -36,7 +36,11 @@
 </template>
 
 <script>
-	import {mapState,mapActions,mapMutations} from 'vuex'
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
 	export default {
 		data() {
 			return {
@@ -45,9 +49,9 @@
 				listName: [],
 				value: null,
 				id: null,
-				parm:{
-					name:null,
-					id:null
+				parm: {
+					name: null,
+					id: null
 				},
 				showOrNo: null
 			};
@@ -117,13 +121,20 @@
 				this.parm.id = id;
 			},
 			...mapActions('chart', ['updata']),
-			updata(){
-				debugger;
-				this.updata(this.parm)
-				.then(data => {
-					var merchantList = data;
+			updata1() {
+				if (this.parm != null) {
+					this.updata(this.parm)
+						.then(res => {
+							debugger;
+							var merchantList = res;
+							uni.showModal({
+								title: '提示',
+								content: '名称:' + this.parm.name + res.message,
+							});
+						}, _ => void uni.stopPullDownRefresh());
 				}
-				, _ => void uni.stopPullDownRefresh());
+
+
 			}
 		}
 	}

+ 1 - 1
store/modules/chart.js

@@ -30,7 +30,7 @@ export default {
 			return apis.sz.post('/TEquipment/updateName',param)
 				.then(res => {
 					const { data } = res;
-					return data;
+					return res;
 				});
 		},
 	}