Browse Source

订单新增页面调整

nanMing 1 year ago
parent
commit
6a3362c5eb
4 changed files with 74 additions and 53 deletions
  1. 2 8
      common/request.js
  2. 0 7
      pages/login/login.vue
  3. 58 33
      pages/my/index.vue
  4. 14 5
      pages/order/add.vue

+ 2 - 8
common/request.js

@@ -16,12 +16,6 @@ const request = config => {
 		config.header['Authorization'] = 'Bearer ' + getToken()
 		isRequest = true
 	} else {
-		uni.getUserInfo({ // 获取用户头像并存储
-			provider: 'weixin',
-			withCredentials: true,
-		}).then((userData) => {
-			uni.setStorageSync('avatar', userData.userInfo.avatarUrl)
-		})
 		uni.login({ // 获取用户登录凭证换取openid
 			provider: 'weixin',
 			success: (loginInfo) => {
@@ -70,7 +64,7 @@ const request = config => {
 
 
 	if (isRequest) {
-		console.log("请求",BASE_URL + config.url, config)
+		// console.log("请求",BASE_URL + config.url, config)
 		return new Promise((resolve, reject) => {
 			uni.request({
 				header: config.header,
@@ -80,7 +74,7 @@ const request = config => {
 				url: BASE_URL + config.url,
 				data: config.data,
 			}).then((res) => {
-				console.log("请求返回:", res)
+				// console.log("请求返回:", res)
 				if (res.statusCode === 200) {
 					const {
 						code,

+ 0 - 7
pages/login/login.vue

@@ -45,13 +45,6 @@
       submitForm() {
         this.$refs.loginForm.validate().then(() => {
           // #ifdef MP-WEIXIN
-          uni.getUserInfo({ // 获取用户头像并存储
-            provider: 'weixin',
-            withCredentials: true,
-          }).then((userData) => {
-            uni.setStorageSync('avatar', userData.userInfo.avatarUrl)
-          })
-
           uni.login({ // 获取用户登录凭证换取openid
             provider: 'weixin',
             success: (loginRes) => {

+ 58 - 33
pages/my/index.vue

@@ -1,45 +1,70 @@
 <template>
-	<view class="content">
-		<view style="height: 190px;background-color: bisque;"></view>
-		<!-- leftTitle:标题  icon:左边图标 @click:点击事件  -->
-		<cc-wxMenuBtn leftTitle="我的报名" icon="../../static/image/add.png" @click="goFunctionClick(0)"></cc-wxMenuBtn>
-		<cc-wxMenuBtn leftTitle="我的交易" icon="../../static/image/add.png" @click="goFunctionClick(1)"></cc-wxMenuBtn>
-		<cc-wxMenuBtn leftTitle="我的兑换" icon="../../static/image/add.png" @click="goFunctionClick(1)"></cc-wxMenuBtn>
-		<cc-wxMenuBtn leftTitle="我的资料" icon="../../static/image/add.png" @click="goFunctionClick(3)"></cc-wxMenuBtn>
-
-	</view>
+  <view class="content">
+    <view style="margin:80rpx auto; text-align: center;">
+      <image class="avatar" src="../../static/image/head.png" mode="aspectFit"></image>
+      <view>{{userInfo.nickName }}</view>
+      <view>{{userInfo.userName }}</view>
+    </view>
+    <!-- leftTitle:标题  icon:左边图标 @click:点击事件  -->
+<!--    <cc-wxMenuBtn leftTitle="我的报名" icon="../../static/image/add.png" @click="goFunctionClick(0)"></cc-wxMenuBtn>
+    <cc-wxMenuBtn leftTitle="我的交易" icon="../../static/image/add.png" @click="goFunctionClick(1)"></cc-wxMenuBtn>
+    <cc-wxMenuBtn leftTitle="我的兑换" icon="../../static/image/add.png" @click="goFunctionClick(1)"></cc-wxMenuBtn>
+    <cc-wxMenuBtn leftTitle="我的资料" icon="../../static/image/add.png" @click="goFunctionClick(3)"></cc-wxMenuBtn> -->
+    <view class="bottomButton">
+      <button type="primary" size="mini" @click="loginOut">解除绑定</button>
+    </view>
+  </view>
 
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
+  export default {
+    data() {
+      return {
+        userInfo: {},
+      }
+
+    },
+    computed: {},
+    onLoad(options) {
+      this.userInfo = uni.getStorageSync('userInfo')
+    },
+    methods: {
+      goFunctionClick(flag) {
 
-			}
+        console.log("点击的功能菜单 = " + flag);
+        uni.showModal({
+          title: '温馨提示',
+          content: '我点击的是第' + (flag + 1) + '个功能菜单'
+        })
+      }
 
-		},
-		computed: {},
-		onLoad: function(options) {
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .avatar {
+    height: 120rpx;
+    width: 120rpx;
+  }
 
-		},
-		methods: {
-			goFunctionClick(flag) {
+  .content {
+    display: flex;
+    flex-direction: column;
+  }
 
-				console.log("点击的功能菜单 = " + flag);
-				uni.showModal({
-					title: '温馨提示',
-					content: '我点击的是第' + (flag + 1) + '个功能菜单'
-				})
-			}
+  .bottomButton {
+    height: 140rpx;
+    width: 60%;
+    margin: 0 auto;
+    text-align: center;
 
-		}
-	}
-</script>
-<style scoped>
-	.content {
-		display: flex;
-		flex-direction: column;
+    button {
+      width: 40%;
+    }
 
-	}
+    button+button {
+      margin-left: 15px;
+    }
+  }
 </style>

+ 14 - 5
pages/order/add.vue

@@ -1,7 +1,7 @@
 <template>
   <view>
     <uni-section padding>
-      <uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules">
+      <uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules" label-width="80px" label-align="right">
         <uni-forms-item label="产品" required name="cpId">
           <uni-data-select v-model="baseFormData.cpId" placeholder="请选择产品" :localdata="cpData" @change="xzcp" />
         </uni-forms-item>
@@ -52,7 +52,7 @@
         </uni-forms-item>
 
         <view class="bottomButton">
-          <button type="primary" @click="submit()" v-show="baseFormData.ddzt == null ||baseFormData.ddzt == 0">保存</button>
+          <button v-show="baseFormData.ddzt == null || baseFormData.ddzt == 0" type="primary" @click="submit()" size="mini">保存</button>
         </view>
       </uni-forms>
     </uni-section>
@@ -223,10 +223,19 @@
   }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
   .bottomButton {
     height: 140rpx;
-    width: 80%;
-    margin-left: 10%;
+    width: 60%;
+    margin: 0 auto;
+    text-align: center;
+
+    button {
+      width: 40%;
+    }
+
+    button+button {
+      margin-left: 15px;
+    }
   }
 </style>