Blame view

pages/my/my.vue 10.7 KB
4dfe89e4   monkeyhouyi   初始化
1
2
  <template>
  	<view class="page">
c62ab6f2   杨鑫   1
3
4
  		<view style="position: absolute; top: 0; width: 100%;">
  			<image :src="$imgUrl('/bg.png')" style="width: 100%; height: 490rpx;border-radius: 0 0 40rpx 40rpx;"></image></view>
4dfe89e4   monkeyhouyi   初始化
5
6
7
  		<view class="my-top">
  			<view class="head" :style="'background-color: rgba(38,197,112,'+(scrollTop/50)+');'">
  				<view class="logo-title">
c62ab6f2   杨鑫   1
8
  					<image :src="$imgUrl('/logo.png')" ></image>
4dfe89e4   monkeyhouyi   初始化
9
10
11
12
13
14
15
16
17
18
19
  				</view>
  				<view class="title">
  					
  				</view>
  				<view class="setting-mess"></view>
  			</view>
  		</view>
  
  		<view class="main">
  			<view class="user-info" @click="myMsg">
  				<view class="portrait">
c62ab6f2   杨鑫   1
20
  					<image :src="$imgUrl('/img/head.jpg')"  v-if="Islogin"></image>
4dfe89e4   monkeyhouyi   初始化
21
22
23
24
25
26
27
28
29
  					<image :src="shopMsg.shopLogo" v-else></image>
  				</view>
  				<view class="info">
  					<view class="nickname">
  						<text v-if="Islogin">请登录</text>
  						<text v-else >{{shopMsg.shopName}}</text>
  					</view>
  					<view class="rank">
  						<view class="rank-box">
c62ab6f2   杨鑫   1
30
  						<image :src="$imgUrl('/vip.png')" ></image>
4dfe89e4   monkeyhouyi   初始化
31
32
33
34
35
36
  						<text v-if="Islogin"></text>
  						<text v-else >{{shopMsg.shopReturn.returnAdress}}有限公司</text>
  						</view>
  					</view>
  				</view>
  				<view class="user-right">
c62ab6f2   杨鑫   1
37
  					<image :src="$imgUrl('/right1.png')" ></image>
4dfe89e4   monkeyhouyi   初始化
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  				</view>
  			</view>
  			<!-- 我的服务 -->
  			<view class="message-list">
  			<view class="titleall-box">
  				<view class="titleall-left"><view class="titleall-left-line"></view>招商及推广服务</view>
  			</view>
  			<view class="my-service">
  				<view class="service-list">
  					<view class="service-list-list">
  						<view class="thumb">
  							 <text v-if="Islogin">0</text>
  							 <text v-else>3</text>
  						</view>
  						<view class="name" @click="questionnaire">
  							<text>我的问卷</text>
  						</view>
  					</view>
  					<view class="service-list-list">
  						<view class="thumb">
  							<text v-if="Islogin">0</text>
  							<text v-else>8</text>
  						</view>
  						<view class="name" @click="myativity">
  							<text>我的活动</text>
  						</view>
  					</view>
  					<view class="service-list-list" @click="apply">
  						<view class="thumb">
  							<text v-if="Islogin">0</text>
  							<text v-else>2</text>
  						</view>
  						<view class="name">
  							<text>我的招商</text>
  						</view>
  					</view>
  					<view class="service-list-list" @click="projectM">
  						<view class="thumb">
  							 <text v-if="Islogin">0</text>
  							<text v-else>{{tuiguang}}</text>
  						</view>
  						<view class="name">
  							<text>我的推广</text>
  						</view>
  					</view>
  				</view>
  			</view>
  			</view>
  			<!-- 我的服务 -->
  			<view class="message-list">
  			<view class="titleall-box">
  				<view class="titleall-left"><view class="titleall-left-line"></view>商城数据</view>
  			</view>
  			<view class="my-service-two">
  				<view class="" v-if="Islogin">
  					<view style="padding: 10px;text-align: center;">暂无数据</view>
  				</view>
  				<view class="service-list-two" v-else>
  					<view class="service-list-list-two">
  						<view class="thumb">
  							{{tongji.money || 0}}
  						</view>
  						<view class="name">
  							<text>今日收入</text>
  						</view>
  					</view>
  					<!-- <view class="service-list-list-two">
  						<view class="thumb">
  							275
  						</view>
  						<view class="name">
  							<text>退款金额</text>
  						</view>
  					</view> -->
  					<view class="service-list-list-two">
  						<view class="thumb">
  							{{tongji.total}}
  						</view>
  						<view class="name">
  							<text>访客数</text>
  						</view>
  					</view>
  					<!-- <view class="service-list-list-two">
  						<view class="thumb">
  							135
  						</view>
  						<view class="name">
  							<text>订单量</text>
  						</view>
  					</view> -->
  					<view class="service-list-list-two">
  						<view class="thumb">
  						{{tongji.rate || `0%`}}
  						</view>
  						<view class="name">
  							<text>转化率</text>
  						</view>
  					</view>
  					<!-- <view class="service-list-list-two">
  						<view class="thumb">
  							10%
  						</view>
  						<view class="name">
  							<text>复购率</text>
  						</view>
  					</view> -->
  				</view>
  				
  			</view>
  			</view>
  			<view class="message-list">
  				<view class="titleall-box">
  					<view class="titleall-left"><view class="titleall-left-line"></view>我的服务</view>
  				</view>
  				<view class="list" @click="shopjcMsg">
  					<view class="icon-data">
  						<view class="icon">
c62ab6f2   杨鑫   1
155
  							<image :src="$imgUrl('/my-icon1.png')" mode=""></image>
4dfe89e4   monkeyhouyi   初始化
156
157
158
159
160
161
162
163
  						</view>
  						<view class="data">
  							<view class="title">
  								<text>商家基本信息</text>
  							</view>
  						</view>
  					</view>
  					<view class="more">
c62ab6f2   杨鑫   1
164
  						<image :src="$imgUrl('/right2.png')"></image>
4dfe89e4   monkeyhouyi   初始化
165
166
167
168
169
  					</view>
  				</view>
  				<view class="list" @click="recordService">
  					<view class="icon-data">
  						<view class="icon">
c62ab6f2   杨鑫   1
170
  							<image :src="$imgUrl('/my-icon2.png')" mode=""></image>
4dfe89e4   monkeyhouyi   初始化
171
172
173
174
175
176
177
178
  						</view>
  						<view class="data">
  							<view class="title">
  								<text>服务记录</text>
  							</view>
  						</view>
  					</view>
  					<view class="more">
c62ab6f2   杨鑫   1
179
  						<image :src="$imgUrl('/right2.png')"></image>
4dfe89e4   monkeyhouyi   初始化
180
181
182
183
184
  					</view>
  				</view>
  				<view class="list" @click="repair">
  					<view class="icon-data">
  						<view class="icon">
c62ab6f2   杨鑫   1
185
  							<image :src="$imgUrl('/my-icon3.png')" mode=""></image>
4dfe89e4   monkeyhouyi   初始化
186
187
188
189
190
191
192
193
  						</view>
  						<view class="data">
  							<view class="title">
  								<text>故障报修</text>
  							</view>
  						</view>
  					</view>
  					<view class="more">
c62ab6f2   杨鑫   1
194
  						<image :src="$imgUrl('/right2.png')"></image>
4dfe89e4   monkeyhouyi   初始化
195
196
197
198
199
  					</view>
  				</view>
  				<view class="list" @click="complaint">
  					<view class="icon-data">
  						<view class="icon">
c62ab6f2   杨鑫   1
200
  							<image :src="$imgUrl('/my-icon2.png')" mode=""></image>
4dfe89e4   monkeyhouyi   初始化
201
202
203
204
205
206
207
208
  						</view>
  						<view class="data">
  							<view class="title">
  								<text>投诉建议</text>
  							</view>
  						</view>
  					</view>
  					<view class="more">
c62ab6f2   杨鑫   1
209
  						<image :src="$imgUrl('/right2.png')"></image>
4dfe89e4   monkeyhouyi   初始化
210
211
212
213
214
  					</view>
  				</view>
  				<view class="list" @click="handleApplySettle">
  					<view class="icon-data">
  						<view class="icon">
c62ab6f2   杨鑫   1
215
  							<image :src="$imgUrl('/my-icon4.png')" mode=""></image>
4dfe89e4   monkeyhouyi   初始化
216
217
218
219
220
221
222
223
  						</view>
  						<view class="data">
  							<view class="title">
  								<text>商城入驻申请</text>
  							</view>
  						</view>
  					</view>
  					<view class="more">
c62ab6f2   杨鑫   1
224
  						<image :src="$imgUrl('/right2.png')"></image>
4dfe89e4   monkeyhouyi   初始化
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
  					</view>
  				</view>
  			</view>
  		</view>
  		<!-- tabbar -->
  		<tabbar :tabBarShow="3"></tabbar>
  	</view>
  </template>
  
  <script>
  	import tabbar from '../../components/tabbar/tabbar.vue';
  	import {
  		Encrypt
  	} from '../../utils/secret'
  	export default {
  		components: {
  			tabbar,
  		},
  		data() {
  			return {
  				Islogin:true,
  				scrollTop: 0,
  				isHotline: false,
  				shopMsg:{},
  				pageindex: {
  					pageNumber: 1,
  					pageSize: 10
  				},
  				tuiguang:'',
  				tongji:{}
  			};
  		},
  		onload(){
  
  		},
  		onShow() {
  		let shopId = {
  			shopId:uni.getStorageSync('shopId') || ''
  		}
  		  const isLogin = uni.getStorageSync('token');
  		  console.log(isLogin)
  		  if (isLogin =='') { 
  		    // 如果未登录,跳转到登录页面
  		        	uni.navigateTo({
  		        	  url: '/pages/login/login'
  		        	})
  		  }else{
  			  let page={
  				condition:2
  			  }
  			 this.$http.sendRequest('/shop/getById', 'POST',shopId).then(res => {
  				 if(res.data.code !="20004"){
  					 this.shopMsg = res.data.data
  					 this.Islogin= false
  					 this.$http.sendRequest('/index/index', 'POST',page).then(res => {
  					 	//成功回调
  					 				console.log(res)
  					 									this.tongji = res.data.data
  					 })
  				 }else{
  					 uni.navigateTo({
  					   url: '/pages/login/login'
  					 })
  				 }
  					 
  				
  			 	//成功回调
  				
  			 })
  			 
  		  }		
  		
  		},
  		onReady() {
  			uni.hideTabBar();
  		},
  		onPageScroll(e) {
  			this.scrollTop = e.scrollTop;
  		},
  		mounted(){
  			this.getALL()
  		},
  		methods: {
  			getALL(){
  				this.pageindex.createUser =uni.getStorageSync('shopId')
  				this.$http.sendRequest('/cerePromotion/queryByPage', 'POST', this.pageindex,1).then(res => {
  					//成功回调
  					this.tuiguang = res.data.data.content.length
c62ab6f2   杨鑫   1
313
  				
4dfe89e4   monkeyhouyi   初始化
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
  				})
  			},
  			recordService() {
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/recordService/recordService'
  					})	
  				}
  				
  			},
  			complaint() {
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/complaint/complaint'
  					})
  				}
  				
  			},
  			repair() {
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/repair/repair'
  					})
  				}
  				
  			},
  			apply() {
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/record/record'
  					})
  				}
  				
  			},
  			myativity(){
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/mycreated/mycreated'
  					})
  				}
  				
  			},
  			questionnaire(){
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: '/pages/questionnaire/questionnaire'
  					})
  				}
  				
  			},
  			shopjcMsg(){
  				let shop = JSON.stringify(this.shopMsg)
  				if(this.Islogin == false){
  					uni.navigateTo({
  						url: `/pages/shopjcMsg/shopjcMsg?shopMsg=${shop}`
  					})
  				}
  				
  			},
  			projectM(){
  				if(this.Islogin == false){
  						uni.navigateTo({
  							url: '/pages/projectManagement/projectManagement'
  						})
  				}
  			
  			},
  			handleApplySettle() {
  				const res = uni.getStorageSync('token');
  				let token = Encrypt(res)
  				let username = this.shopMsg.shopName
  				let url = 'http://8.130.38.56:8027/settled-merchant'
  				// #ifdef H5
  				console.log('h5 test')
  				window.location.href = url + `/#/?username=${ username }&user=${ token }`
  				// #endif
  				// #ifdef APP-PLUS
  				plus.runtime.openURL(url + `/#/?username=${ username }&user=${ token }`, function(
  				e) {
  					console.log(e);
  				})
  				// #endif
  				// #ifdef MP-WEIXIN
  				uni.navigateTo({
  					url: `../linkOthers/index?url=${ url }&username=${ username }&user=${ token }`
  					// 此处的链接为小程序上面新建的webview页面路径,参数url为要跳转外链的地址
  					// url: '../../../pages_category_page1/linkOthers/index?url=' + encodeURIComponent(url)
  					// url:'../../../pages_category_page2/userModule/coupon'
  				})
  				// #endif
  				// #ifdef MP-ALIPAY
  				uni.navigateTo({
  					url: `../linkOthers/index?url=${ url }&username=${ username }&user=${ token }`
  					// 此处的链接为小程序上面新建的webview页面路径,参数url为要跳转外链的地址
  					// url: '../../../pages_category_page1/linkOthers/index?url=' + encodeURIComponent(url)
  					// url:'../../../pages_category_page2/userModule/coupon'
  				})
  				// #endif
  			},
  			myMsg(){
  				const res = uni.getStorageSync('token');
  				if(res ==''){
  					uni.navigateTo({
  					  url: '/pages/login/login'
  					})
  				}else{
  					let shop = JSON.stringify(this.shopMsg)
  					if(this.Islogin == false){
  						uni.navigateTo({
  							url: `/pages/shopjcMsg/shopjcMsg?shopMsg=${shop}`
  						})
  					}
  				}
  			}
  		}
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'my.scss';
  </style>