jinx 3 gadi atpakaļ
vecāks
revīzija
3b5ba3e2e3
3 mainītis faili ar 51 papildinājumiem un 43 dzēšanām
  1. 43 42
      pages/ucenter/index/index.wxml
  2. 7 0
      pages/user/user.js
  3. 1 1
      pages/user/user.wxml

+ 43 - 42
pages/ucenter/index/index.wxml

@@ -1,68 +1,69 @@
 <view class="container">
   <auth bindlogin="onShow" />
-	
+
   <lip-sync />
   <view class="userinfo">
     <image src="../../../static/images/ucenterbg.png" class="user-bg"></image>
-    <view class="u-avatar"  bindtap="tapByIdx" data-url="/pages/user/user">
+    <view class="u-avatar" bindtap="tapByIdx" data-url="/pages/user/user">
       <!-- <button class="btn-cls" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"></button> -->
-      <image  class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image>
-      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
+      <image class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image>
+      <text class="userinfo-nickname" wx:if="{{userInfo.nickName==''}}">【请输入昵称】</text>
+      <text class="userinfo-nickname" wx:else>{{userInfo.nickName}}</text>
     </view>
-    <view class="userinfo-setting navigator"  bindtap="tapByIdx" data-url="/pages/user/user">
+    <view class="userinfo-setting navigator" bindtap="tapByIdx" data-url="/pages/user/user">
       <image wx:if="{{imgServer}}" src="../../../static/images/c_setting.png"></image>
     </view>
-	</view>
+  </view>
+
 
-  
   <view class="order-list">
 
 
-      <view wx:for="{{orderList}}"  bindtap="tapByIdx" wx:key="{{item.id}}" data-url="{{'/pages/ucenter/order/order?id='+item.id}}" class="navigator a">
-        <view class="icon-item">
-          <image wx:if="{{imgServer}}" src="{{'/static/images/'+item.icon+'.png'}}"></image>
-          <span class="count" wx:if="{{item.count}}">{{item.count}}</span>
-        </view>
-        <view class="txt">{{item.name}}</view>
+    <view wx:for="{{orderList}}" bindtap="tapByIdx" wx:key="{{item.id}}" data-url="{{'/pages/ucenter/order/order?id='+item.id}}" class="navigator a">
+      <view class="icon-item">
+        <image wx:if="{{imgServer}}" src="{{'/static/images/'+item.icon+'.png'}}"></image>
+        <span class="count" wx:if="{{item.count}}">{{item.count}}</span>
       </view>
-      
-      <view class="i-line"></view>
-      
-      <view  bindtap="tapByIdx" data-url="{{'/pages/ucenter/order/order?id='+all.id}}" class="navigator a or-a">
-        <view class="icon-item">
-          <image wx:if="{{imgServer}}" src="{{'/static/images/'+all.icon+'.png'}}"></image>
-        </view>
-        <view class="txt">{{all.name}}</view>
+      <view class="txt">{{item.name}}</view>
+    </view>
+
+    <view class="i-line"></view>
+
+    <view bindtap="tapByIdx" data-url="{{'/pages/ucenter/order/order?id='+all.id}}" class="navigator a or-a">
+      <view class="icon-item">
+        <image wx:if="{{imgServer}}" src="{{'/static/images/'+all.icon+'.png'}}"></image>
       </view>
+      <view class="txt">{{all.name}}</view>
+    </view>
   </view>
 
-    <view class="order-list-v">
-      <view wx:for="{{barList}}"  bindtap="tapByIdx" wx:key="{{item.id}}"  data-url="{{item.url}}" class="navigator a">
-        <image wx:if="{{imgServer}}" src="{{'/static/images/'+item.icon+'.png'}}"></image>
-        <view>{{item.name}}</view>
-        <image src="/static/images/go.png" class="go"></image>
-      </view>
-      <view bindtap="toReport"   class="navigator a {{ hasBrand ? '' : 'hidden'}}">
-        <image src="{{'/static/images/report.png'}}"></image>
-        <view>数据统计</view>
-        <image src="/static/images/go.png" class="go"></image>
-      </view>
+  <view class="order-list-v">
+    <view wx:for="{{barList}}" bindtap="tapByIdx" wx:key="{{item.id}}" data-url="{{item.url}}" class="navigator a">
+      <image wx:if="{{imgServer}}" src="{{'/static/images/'+item.icon+'.png'}}"></image>
+      <view>{{item.name}}</view>
+      <image src="/static/images/go.png" class="go"></image>
+    </view>
+    <view bindtap="toReport" class="navigator a {{ hasBrand ? '' : 'hidden'}}">
+      <image src="{{'/static/images/report.png'}}"></image>
+      <view>数据统计</view>
+      <image src="/static/images/go.png" class="go"></image>
     </view>
-    <view class="order-list-v">
-      <!-- <view  bindtap="tapByIdx" data-url="/pages/ucenter/feedback/feedback" class="navigator a">
+  </view>
+  <view class="order-list-v">
+    <!-- <view  bindtap="tapByIdx" data-url="/pages/ucenter/feedback/feedback" class="navigator a">
         <image wx:if="{{imgServer}}" src="/static/images/cb3.png"></image>
         <view>意见反馈</view>
         <image src="/static/images/go.png" class="go"></image>
       </view> -->
-      <view class="navigator" >
-        <button open-type="contact">
-          <image wx:if="{{imgServer}}" src="{{imgServer+'/cb4.png'}}"></image>
-          <view>联系客服</view>
-          <image src="/static/images/go.png" class="go"></image>
-        </button>
-      </view>
+    <view class="navigator">
+      <button open-type="contact">
+        <image wx:if="{{imgServer}}" src="{{imgServer+'/cb4.png'}}"></image>
+        <view>联系客服</view>
+        <image src="/static/images/go.png" class="go"></image>
+      </button>
     </view>
-    <!-- <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
+  </view>
+  <!-- <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
     <view class="h">
       <view class="line"></view>
       <text class="title">大家都在看</text>

+ 7 - 0
pages/user/user.js

@@ -86,6 +86,13 @@ Page({
 
   async save() {
     console.log(this.file)
+    if(this.data.nickname==""){
+      wx.showToast({
+        title: '请输入昵称',
+        icon:'error'
+      })
+      return
+    }
     if (this.file) {
       let avatar = await (new Promise(r => {
         wx.uploadFile({

+ 1 - 1
pages/user/user.wxml

@@ -11,7 +11,7 @@
     <view class="item">
       <text>用户昵称</text>
       <view class="ir">
-        <input maxlength="15" value="{{nickname}}" class="ipname" bindinput="updateNickName"></input>
+        <input maxlength="15" placeholder="请输入昵称" value="{{nickname}}" class="ipname" bindinput="updateNickName"></input>
       </view>
     </view>
     <view class="item">