Jelajahi Sumber

fix: config username and user head img

wangyuan 2 tahun lalu
induk
melakukan
d591c6be6e

+ 11 - 2
pages/appointment/appointment.js

@@ -23,7 +23,9 @@ Page({
     backupWeekList: [],
     currentTime: '',
     currentWeek: '',
-    currentYear: ''
+    currentYear: '',
+    appusername: '',
+    appuserheadimg: ''
   },
 
   /**
@@ -37,7 +39,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    this.getAccountNmberFn() 
+    this.getAccountNmberFn()
+    this.setData({
+      appusername: app.globalData.userInfo.userName.length > 4 ? app.globalData.userInfo.userName.substring(0,4) : app.globalData.userInfo.userName,
+      appuserheadimg: app.globalData.userInfo.headImg
+    })
     if (app.globalData.navigateBackParams.address) {
       this.setData({
         hasAddress: true,
@@ -308,6 +314,9 @@ Page({
       this.setData({
         appointmentSuccess: true
       })
+      wx.navigateTo({
+        url: '/pages/appointment/appointment?form=appoointment',
+      })
     }).catch(e => {
       wx.hideLoading()
       wx.showModal({

+ 4 - 2
pages/appointment/appointment.wxml

@@ -5,8 +5,10 @@
       <view class="ac-title sub-title">账户信息</view>
       <view class="ac-card ittflex-jcs">
         <view class="ac-left ac-item ittflex-jcs">
-          <view class="ac-avat"></view>
-          <view class="ac-name">测试用户</view>
+          <view class="ac-avat">
+            <image class="headimg" src="{{appuserheadimg}}"></image>
+          </view>
+          <view class="ac-name">{{appusername}}</view>
         </view>
         <view class="ac-right ac-item ittflex-jcs">
           <text class="ac-count">{{accountNumber}}</text>

+ 4 - 1
pages/appointment/appointment.wxss

@@ -33,9 +33,12 @@
   width: 80rpx;
   height: 80rpx;
   border-radius: 50%;
-  background-color: #f66;
   margin: 0 14rpx 0 20rpx;
 }
+.headimg {
+  width: 100%;
+  height: 100%;
+}
 .ac-name {
   font-size: 30rpx;
   font-weight: bold;

+ 7 - 5
pages/buy/buy.wxml

@@ -2,8 +2,10 @@
 <view class="buy-container">
   <view class="header">
     <view class="info">
-      <view class="img"></view>
-      <text class="name">测试用户</text>
+      <view class="img">
+        <image class="headimg" src="{{appuserheadimg}}"></image>
+      </view>
+      <text class="name">{{appusername}}</text>
     </view>
     <view class="span">
       <text class="count">0</text>
@@ -24,18 +26,18 @@
         </view>
       </view> -->
       <block wx:for="{{goodsList}}" wx:key="index">
-        <view class="pay-item four-time {{index == activeIndex ? 'pay-item-active' : ''}}" data-index="{{index}}" bindtap="handlePayType">
+        <view class="pay-item four-time {{index == activeIndex ? 'pay-item-active' : ''}}" data-index="{{index}}" data-goodsinfo="{{item}}" bindtap="handlePayType">
           <view class="p-title-flex">
             <view class="light-text ittflex" wx:if="{{item.isRecommend}}">荐</view>
             <text class="sub-title">{{item.goodsName}}</text>
           </view>
           <view class="p-prise">
             <text class="p-tag">¥</text>
-            <text class="p-num">{{item.oncePrice}}</text>
+            <text class="p-num">{{item.salePrice}}</text>
           </view>
           <view class="tips">
             <text wx:if="{{item.donateNumber > 0}}">加赠{{item.donateNumber}}次,</text>
-            <text>共{{item.useNumber}}次</text>
+            <text>共{{item.donateNumber + item.useNumber}}次</text>
           </view>
           <view class="mark ittflex" wx:if="{{index == activeIndex}}">
             <van-icon name="success" color="#fff" />

+ 4 - 1
pages/buy/buy.wxss

@@ -21,9 +21,12 @@
   width: 80rpx;
   height: 80rpx;
   border-radius: 50%;
-  background-color: #f66;
   margin: 0 20rpx 0 30rpx;
 }
+.headimg {
+  width: 100%;
+  height: 100%;
+}
 .name {
   font-size: 30rpx;
   font-weight: bold;