Jelajahi Sumber

首页商户id

baijunde 1 tahun lalu
induk
melakukan
dd64cb027e
1 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 8 3
      pages/index/index.vue

+ 8 - 3
pages/index/index.vue

@@ -85,7 +85,8 @@
 				income: '', //收益
 				name: '',
 				num: 222,
-				msg: []
+				msg: [],
+				merchantId:''
 			}
 		},
 		onLoad: function() {
@@ -120,7 +121,7 @@
 				})
 			},
 			gettodayData() {
-				this.$http.get("/merchant/app/home/todayData?merchantId=" + '111', {}).then(res => {
+				this.$http.get("/merchant/app/home/todayData?merchantId=" + this.merchantId, {}).then(res => {
 					if (res.data.code == 200) {
 						this.income = res.data.result.income
 						this.newCustomer = res.data.result.newCustomer
@@ -129,7 +130,7 @@
 				})
 			},
 			getMessage(){
-				this.$http.get("/merchant/app/home/realMessage?merchantId=" + '111', {}).then(res => {
+				this.$http.get("/merchant/app/home/realMessage?merchantId=" + this.merchantId, {}).then(res => {
 					if (res.data.code == 200) {
 						this.msg = res.data.result.records
 					// 	this.income = res.data.result.income
@@ -144,10 +145,14 @@
 			this.getMessage()
 			// let info = 
 			let that = this
+		},
+		onShow() {
+			let that = this
 			uni.getStorage({
 				key: 'login_user_info',
 				success: function (res) {
 					that.name = res.data.merchantName
+						that.merchantId = res.data.merchantId
 				}
 			});
 		}