Browse Source

Merge remote-tracking branch 'origin/master'

彭宇 1 year ago
parent
commit
286646c72e

+ 20 - 11
api/me/me.js

@@ -2,24 +2,33 @@ import request from '@/utils/request'
 
 // 获取当前积分
 export function getScore(userId) {
-  return request({
-    url: '/score/getScore?userId='+userId,
-    method: 'get'
-  })
+	return request({
+		url: '/score/getScore?userId=' + userId,
+		method: 'get'
+	})
 }
 
-export function getUserInfo(userId){
+export function getUserInfo(userId) {
 	return request({
-		url: '/system/user/getWxUserInfo/'+userId,
+		url: '/system/user/getWxUserInfo/' + userId,
 		method: 'get'
 	})
 }
 
 // 获取我的付费知识
 export function myPayKnow(query) {
-  return request({
-    url: '/knowledge/base/knowledgePayList',
-    method: 'get',
-	data:query
-  })
+	return request({
+		url: '/knowledge/base/knowledgePayList',
+		method: 'get',
+		data: query
+	})
 }
+
+//上传头像
+export function uploadHeadImg(data) {
+	return request({
+		url: '/system/user/updateWxUserInfo',
+		method: 'get',
+		data: data
+	})
+}

+ 28 - 0
pages/handleAffairs/dept/dept.vue

@@ -119,6 +119,34 @@
 		padding: 1%;
 		box-shadow: 0px 0px 6px 0px gray;
 	}
+	.btnContain button:nth-child(1){
+		text-indent: 20%;
+		text-align:left;
+	}
+	.btnContain button:nth-child(2){
+		/* text-indent: 35%; */
+		text-align:left;
+	}
+	.btnContain button:nth-child(1)::after{
+		content:'';
+		width: 38%;
+		height: 94%;
+		position: absolute;
+		top: 25%;
+		left: -2%;
+		background: url('@/static/images/more/accounter.png') 0 0 no-repeat;
+		background-size: 100% 100%;
+	}
+	.btnContain button:nth-child(2)::after{
+		content:'';
+		width: 38%;
+		height: 94%;
+		position: absolute;
+		top: 25%;
+		left: 20%;
+		background: url('@/static/images/more/personLegal.png') 0 0 no-repeat;
+		background-size: 100% 100%;
+	}
 	.uni-grid{
 		flex-wrap:wrap
 	}

+ 29 - 2
pages/handleAffairs/topic/topic.vue

@@ -96,6 +96,33 @@
 	html,body{
 		background-color: #fff;
 	}
+	.btnContain button:nth-child(1){
+		text-indent: 20%;
+		text-align:left;
+	}
+	.btnContain button:nth-child(2){
+		text-align:left;
+	}
+	.btnContain button:nth-child(1)::after{
+		content:'';
+		width: 40%;
+		height: 94%;
+		position: absolute;
+		top: 25%;
+		left: -2%;
+		background: url('@/static/images/more/accounter.png') 0 0 no-repeat;
+		background-size: 100% 100%;
+	}
+	.btnContain button:nth-child(2)::after{
+		content:'';
+		width: 40%;
+		height: 94%;
+		position: absolute;
+		top: 25%;
+		left: 20%;
+		background: url('@/static/images/more/personLegal.png') 0 0 no-repeat;
+		background-size: 100% 100%;
+	}
 	.not-highlight{
 		color:#000;
 	}
@@ -124,7 +151,7 @@
 		justify-content: space-between;
 		margin:2% auto auto auto;
 		padding: 1%;
-		box-shadow: 0px 0px 6px 0px gray;
+		box-shadow: 0px 0px 2px 0px gray;
 	}
 	.btnContain::after{
 		content: '';
@@ -138,7 +165,7 @@
 		background-color: #E1E1E1;
 	}
 	button {
-		width: 30%;
+		width: 35%;
 		border: none;
 		background-color: #fff;
 	}

+ 82 - 60
pages/me/me.vue

@@ -2,121 +2,143 @@
 	<!-- pages/me.wxml -->
 	<view class="uni-container">
 		<view class="uni-header-logo">
-			<img class="uni-header-image" :src="initInfo.headImg == null || initInfo.headImg == '' ? 'http://116.142.80.12:9000/10_03.png' : initInfo.headImg" />
-			<span>{{initInfo.name == null || initInfo.name == '' ? initInfo.wechatName : initInfo.name}}</span>
-			<text>{{initInfo.scoreNum}}</text>
+			<img
+				@headImg="uploadHeadImg"
+				@click="updateImg"
+				class="uni-header-image"
+				:src="initInfo.headImg == null || initInfo.headImg == '' ? initImgPath : loadImgSrc(initInfo.headImg)"
+			/>
+			<span>{{ initInfo.name == null || initInfo.name == '' ? initInfo.wechatName : initInfo.name }}</span>
+			<text>{{ initInfo.scoreNum }}</text>
 		</view>
 		<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
 			<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="goDetailPage(item.id)">
-				<text class="uni-panel-text">{{item.name}}</text>
-				<text class="uni-panel-icon uni-icon" :class="item.open ? 'uni-panel-icon-on' : ''">{{item.pages ? '&#xe581;' : '&#xe470;'}}</text>
+				<text class="uni-panel-text">{{ item.name }}</text>
+				<text class="uni-panel-icon uni-icon" :class="item.open ? 'uni-panel-icon-on' : ''">{{ item.pages ? '&#xe581;' : '&#xe470;' }}</text>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-import {getScore, getUserInfo} from '@/api/me/me.js'
-// pages/me.js
+import { getScore, getUserInfo, uploadHeadImg } from '@/api/me/me.js';
+import { getToken } from '@/utils/auth';
 export default {
 	data() {
 		return {
-			initInfo:{
-				userId: null,
+			headers: {
+				Authorization: 'Bearer ' + getToken()
+			},
+			initImgPath: 'http://116.142.80.12:9000/10_03.png',
+			initInfo: {
+				id: getApp().globalData.userId,
 				scoreNum: 0,
-				wechatName: "微信用户",
+				wechatName: '微信用户',
 				name: null,
-				headImg: null,
+				headImg: null
 			},
 			list: [
 				{
-					id: 'me/meOperate/meOperate',//id是文件路径
+					id: 'me/meOperate/meOperate', //id是文件路径
 					name: '我的积分流水',
-					open: false,
+					open: false
 				},
 				{
 					id: 'demo/wenba/wenba',
 					name: '我的问答',
-					open: false,
+					open: false
 				},
 				{
 					id: 'me/nameAuthentication/nameAuthentication',
 					name: '实名认证',
-					open: false,
+					open: false
 				},
 				{
 					id: 'me/officialAuthentication/officialAuthentication',
 					name: '官方认证',
-					open: false,
+					open: false
 				},
 				{
 					id: 'matters/matters',
 					name: '我的事项',
-					open: false,
+					open: false
 				},
 				{
 					id: 'me/myPayKnow/myPayKnow',
 					name: '我的付费知识',
-					open: false,
+					open: false
 				}
-			]
+			],
 		};
 	},
 	/**
-	 * 生命周期函数--监听页面加载
-	 */ onLoad(options) {},
-	/**
 	 * 生命周期函数--监听页面初次渲染完成
 	 */
 	onReady() {
-		this.userId = getApp().globalData.userId
-		this.getUserInfoByUserId(this.userId)
-		this.getScoreForMe(this.userId)
+		this.getUserInfoByUserId(this.initInfo.id);
+		this.getScoreForMe(this.initInfo.id);
 	},
-	/**
-	 * 生命周期函数--监听页面显示
-	 */
-	onShow() {},
-	/**
-	 * 生命周期函数--监听页面隐藏
-	 */
-	onHide() {},
-	/**
-	 * 生命周期函数--监听页面卸载
-	 */
-	onUnload() {},
-	/**
-	 * 页面相关事件处理函数--监听用户下拉动作
-	 */
-	onPullDownRefresh() {},
-	/**
-	 * 页面上拉触底事件的处理函数
-	 */
-	onReachBottom() {},
-	/**
-	 * 用户点击右上角分享
-	 */
-	onShareAppMessage() {},
 	methods: {
 		goDetailPage(e) {
-				const url = '/pages/' + e
-				uni.navigateTo({
-					url: url
-				})
+			const url = '/pages/' + e;
+			uni.navigateTo({
+				url: url
+			});
 		},
 		//获取用户信息:用户名称:头像
-		getUserInfoByUserId(userId){
-			getUserInfo(userId).then(res =>{
+		getUserInfoByUserId(userId) {
+			console.log(userId)
+			getUserInfo(userId).then((res) => {
 				this.initInfo.wechatName = res.data.wechatName;
 				this.initInfo.name = res.data.name;
 				this.initInfo.headImg = res.data.headImg;
-			})
+			});
 		},
 		//获取当前积分
-		getScoreForMe(userId){
-			getScore(this.userId).then(res =>{
-				this.initInfo.scoreNum = res.data.scoreNum
-			})
+		getScoreForMe(userId) {
+			console.log(userId)
+			getScore(userId).then((res) => {
+				this.initInfo.scoreNum = res.data.scoreNum;
+			});
+		},
+		updateImg() {
+			let _this = this;
+			uni.chooseImage({
+				success(resp) {
+					uni.uploadFile({
+						url: _this.$HTTP + `/common/upload`,
+						filePath: resp.tempFilePaths[0],
+						name: 'file',
+						formData: {},
+						header: _this.headers,
+						success: (res) => {
+							// 判断是否json字符串,将其转为json格式
+							let data = JSON.parse(res.data);
+							if (![200].includes(data.code)) {
+								_this.$modal.msg(data.msg);
+							} else {
+								_this.initInfo.headImg = data.fileName;
+								_this.uploadImg();
+								_this.$modal.msg('更新成功');
+							}
+						},
+						fail: (e) => {
+							debugger;
+							console.log(e);
+							_this.$modal.msg('上传失败!');
+						}
+					});
+				}
+			});
+		},
+		uploadImg(){
+			//更新数据库
+			uploadHeadImg(this.initInfo).then((res) => {
+				console.log(res);
+				if (res.code === 200) {
+					console.log(this.initInfo)
+				}
+			});
 		}
 	}
 };

+ 34 - 22
pages/quotations/quotations.vue

@@ -1,8 +1,8 @@
 <template>
-  <view >
+  <view>
     <view class="nactive">
       <scroll-view class="scroll-view_H" :scroll-x="true" @scroll="scroll" scroll-left="120">
-        <uni-grid :column="5" @change="change" :showBorder="false" :square="true" >
+        <uni-grid :column="5" @change="change" :showBorder="false" :square="true">
           <uni-grid-item v-for="item in categories" :index="item.id">
             <view class="grid-item-box">
               <image class="image" :src="loadImgSrc(item.icon)" mode="aspectFit"></image>
@@ -22,12 +22,12 @@
           <uni-th width="100" align="center">时间</uni-th>
         </uni-tr>
         <uni-tr v-for="(item, index) in quotationsList" :key="index">
-          <uni-td align="center">{{ item.area+item.address }}
+          <uni-td align="center">{{ item.area + item.address }}
           </uni-td>
           <uni-td align="center">{{ item.productName }}
           </uni-td>
           <uni-td align="center">
-            <view class="name">{{ item.type}}</view>
+            <view class="name">{{ item.type }}</view>
           </uni-td>
           <uni-td align="center">{{ item.price }}
           </uni-td>
@@ -52,7 +52,7 @@ export default {
   },
   data() {
     return {
-      book:false,
+      book: false,
 
       //是否显示弹出层
       open: false,
@@ -73,7 +73,7 @@ export default {
         pageNum: 1,
         pageSize: 15,
         id: null,
-        status:"1",
+        status: "1",
       },
       //加载更多
       status: 'more',
@@ -95,19 +95,19 @@ export default {
     this.getList()
   },
   //上拉加载
-  onReachBottom(){
-  	let pageNum = this.queryParams.pageNum
-  	let pageSize = this.queryParams.pageSize
-  	let total = this.total
-  	if(pageNum*pageSize >= total){
-  		uni.showToast({
-  			title:'暂无更多数据'
-  		})
-  		return
-  	} else {
-  		this.queryParams.pageNum += 1;
-  		this.getList()
-  	}
+  onReachBottom() {
+    let pageNum = this.queryParams.pageNum
+    let pageSize = this.queryParams.pageSize
+    let total = this.total
+    if (pageNum * pageSize >= total) {
+      uni.showToast({
+        title: '暂无更多数据'
+      })
+      return
+    } else {
+      this.queryParams.pageNum += 1;
+      this.getList()
+    }
   },
   onLoad() {
     this.getList();
@@ -171,12 +171,14 @@ export default {
 </script>
 
 <style>
-.nactive{
+.nactive {
   padding: 10px 0 10px 0;
 }
-.container{
+
+.container {
   backgroud-color: #f5f5f5;
 }
+
 .grid-item-box {
   flex: 1;
 // position: relative;
@@ -193,8 +195,18 @@ export default {
   height: 100%;
   width: 100%;
 }
-.uni-container{
+
+.uni-container {
   align-items: center;
 }
 
+.gray-background {
+  background-color: gray;
+}
+
+.uni-table-tr:first-child {
+  background-color: #aaaaaa !important;
+}
+
+
 </style>

BIN
static/images/more/accounter.png


BIN
static/images/more/personLegal.png