宇宙无敌M1处理器的MacBook Pro 4 vuotta sitten
vanhempi
commit
7ec746d424

+ 6 - 2
mini/pages/order-detail/index.js

xqd xqd xqd
@@ -23,7 +23,8 @@ Page({
     order_device: {},
     showPrice: false,
     device_quantity: '',
-    right: null
+    right: null,
+    price: ""
   },
 
   /**
@@ -66,6 +67,7 @@ Page({
   updateActionType: function () {
     var actionType = ''
     var role = this.data.role
+    console.log(role)
     var order = this.data.order
     var changePrice = false
     if (order.level == role.level) {
@@ -84,12 +86,14 @@ Page({
   changePrice: function () {
     var order_device = this.data.order_device
     var quantity = this.data.device_quantity
+    var price = this.data.price
     var that = this
     http({
       url: 'orders/change',
       data: {
         id: order_device.id,
-        quantity: quantity
+        quantity: quantity,
+        price: price
       },
       success: function (res) {
         if (res.code == 0) {

+ 10 - 6
mini/pages/order-detail/index.wxml

xqd xqd xqd
@@ -52,7 +52,8 @@
       <block wx:else>
         <view class="sg-item sg-pad sg-margin" wx:for="{{devices}}" wx:key="index" bindtap="selectDevice"
           data-index="{{index}}">
-          <view class="sg-title sg-bold">{{index+1}}. {{item.device_type ? item.device_type.name : ''}} - {{item.device_name ? item.device_name.name : ''}} - {{item.spec ? item.spec.name : ''}}
+          <view class="sg-title sg-bold">{{index+1}}. {{item.device_type ? item.device_type.name : ''}} -
+            {{item.device_name ? item.device_name.name : ''}} - {{item.spec ? item.spec.name : ''}}
           </view>
           <view class="sg-content sg-gray-color sg-font-small">
             <view class="sg-margin-tb-sm sg-flex sg-align-center sg-space-between">
@@ -67,7 +68,7 @@
           <view class="sg-footer sg-flex sg-align-center sg-space-between sg-margin-top-sm">
             <view class="sg-font-lg sg-bold">总金额:¥{{item.price * item.quantity / 100}}</view>
             <view class="sg-btn sg-index-bg sg-pad-sm sg-white" hidden="{{!changePrice}}" bindtap="switchShowPrice"
-              data-item="{{item}}" data-show="{{true}}">更改计数</view>
+              data-item="{{item}}" data-show="{{true}}">{{role.level==2?'更改单价':'更改计数'}}</view>
           </view>
         </view>
       </block>
@@ -88,12 +89,15 @@
     </block>
   </view>
   <van-dialog id="van-dialog" />
-  <van-dialog show="{{ showPrice }}" bind:cancel="closeshow" use-slot title="更改计数" show-cancel-button bind:confirm="changePrice" z-index="1">
+  <van-dialog show="{{ showPrice }}" bind:cancel="closeshow" use-slot title="{{role.level==2?'更改单价':'更改计数'}}"
+    show-cancel-button bind:confirm="changePrice" z-index="1">
     <view class="sg-box sg-pad">
       <view class="sg-form-item sg-pad-tb sg-top-border">
-        <view class="sg-label">租赁计数</view>
-        <input value="{{device_quantity}}" class="sg-input" bindinput="onChange" data-name="device_quantity"
-          placeholder="请输入租赁计数" type="number"></input>
+        <view class="sg-label">{{role.level==2?'租赁单价':'租赁计数'}}</view>
+        <input value="{{device_quantity}}" class="sg-input" wx:if="{{role.level!=2}}" bindinput="onChange"
+          data-name="device_quantity" placeholder="请输入租赁计数" type="number"></input>
+        <input value="{{price}}" class="sg-input" wx:else bindinput="onChange" data-name="price"
+          placeholder="请输入租赁单价" type="number"></input>
       </view>
     </view>
   </van-dialog>

+ 4 - 1
mini/pages/project/index.wxml

xqd
@@ -1,7 +1,10 @@
 <!--pages/project/index.wxml-->
 <view class="sg-container">
   <view class="sg-user-box sg-pad sg-flex sg-align-center">
-    <image class="sg-big-avatar" src="{{userInfo.avatar ? userInfo.avatar : userInfo.avatarUrl}}" mode="widthFix"></image>
+    <view class="sg-big-avatar" wx:if="{{userInfo.avatar==''}}">
+        <open-data type="userAvatarUrl"></open-data>
+      </view>
+    <image wx:else class="sg-big-avatar" src="{{userInfo.avatar ? userInfo.avatar : userInfo.avatarUrl}}" mode="widthFix"></image>
     <view class="sg-right sg-flex-grow">
       <view class="sg-name">{{userInfo.name}}</view>
       <view

+ 1 - 1
mini/utils/env.js

xqd
@@ -1,4 +1,4 @@
-const isTest = false;
+const isTest = true;
 //172.31.31.35
 //172.31.31.92