panhui 4 年 前
コミット
bae51a6dd0

BIN
src/assets/kong_png_wudizhi.png


+ 124 - 14
src/views/asset/Consignment.vue

@@ -7,17 +7,48 @@
             </div>
             <div class="border border1"></div>
             <div class="content">
-                <van-field type="number" label="寄售价格(元)" placeholder="请设置寄售价格" v-model="price" />
+                <div class="title">寄售价格(元)<span>最高定价20000.00</span></div>
+                <!-- <van-field type="number" input-align="center" placeholder="请输入价格" v-model="price" /> -->
+                <van-stepper
+                    v-model="price"
+                    default-value=""
+                    :show-plus="false"
+                    :show-minus="false"
+                    :decimal-length="2"
+                    max="20000"
+                />
+                <div class="title">预计收入(元)</div>
+                <div class="info-item">
+                    <span>寄售定价</span>
+                    <span class="val">{{ price1 }}</span>
+                </div>
+                <div class="info-item">
+                    <span>版税(10.0%)</span>
+                    <span class="val">{{ price2 }}</span>
+                </div>
+                <div class="info-item">
+                    <span>技术服务费(4%) </span>
+                    <span class="val">{{ price3 }}</span>
+                </div>
+                <div class="info-item">
+                    <span>支付通道费(1%)</span>
+                    <span class="val">{{ price4 }}</span>
+                </div>
+                <div class="info-item">
+                    <span>最终收入</span>
+                    <span class="val prim">{{ price5 }}</span>
+                </div>
             </div>
             <div class="border"></div>
             <div class="input">
-                <div class="text1">请输入交易密码,验证信息</div>
+                <div class="text1">请输入交易密码</div>
                 <div v-if="sets">
-                    <van-password-input :value="password" :focused="showKeyboard" @focus="showKeyboard = true" />
+                    <van-password-input :gutter="10" :value="password" :focused="showKeyboard" @focus="keyboardEnter" />
                     <van-number-keyboard
                         v-model="password"
                         :show="showKeyboard"
                         @blur="showKeyboard = false"
+                        :gutter="10"
                         maxlength="6"
                     />
                     <div class="text2" @click="$router.push('/tradingPassword')">忘记密码?</div>
@@ -29,7 +60,7 @@
             <van-notice-bar
                 :color="$colors.prim"
                 :background="$colors.prim"
-                text="出售成功的数字藏品将会携带数字藏品的所有信息转让于购买方,包括但不限于:加密空间、权益的使用、数字藏品的区块信息等"
+                text="出售成功的数字藏品将会携带数字藏品的所有信息转让于购买方,包括但不限于:权益的使用、数字藏品的区块信息等"
             />
             <div class="bottom-content">
                 <div class="btn1" @click="$router.go(-1)">取消</div>
@@ -44,6 +75,7 @@
 import { mapState } from 'vuex';
 export default {
     name: 'Top',
+    inject: ['changeScroll'],
     data() {
         return {
             price: '',
@@ -70,12 +102,36 @@ export default {
         };
     },
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(['userInfo']),
+        price1() {
+            let price = Math.floor(this.price * 100) / 100;
+            return price.toFixed(2);
+        },
+        price2() {
+            let price = Math.floor(this.price * 10) / 100;
+            return price.toFixed(2);
+        },
+        price3() {
+            let price = Math.floor(this.price * 4) / 100;
+            return price.toFixed(2);
+        },
+        price4() {
+            let price = Math.floor(this.price * 1) / 100;
+            return price.toFixed(2);
+        },
+        price5() {
+            let price = Math.floor(this.price * 85) / 100;
+            return price.toFixed(2);
+        }
     },
     mounted() {
         this.passFn();
     },
     methods: {
+        keyboardEnter() {
+            this.changeScroll(1000);
+            this.showKeyboard = true;
+        },
         passFn() {
             this.$http
                 .get('/user/tradeCodeStatus', {
@@ -159,7 +215,7 @@ export default {
 }
 
 .input {
-    padding: 20px 0;
+    padding: 12px 0 20px;
     .text1 {
         font-size: @font2;
         color: @text0;
@@ -177,7 +233,7 @@ export default {
         margin: 10px 0;
         padding: 0 25px;
         .van-password-input__security {
-            border: 1px solid @text3;
+            border-width: 0;
             height: 42px;
             border-radius: 2px;
             li {
@@ -185,6 +241,7 @@ export default {
                 &:not(:last-child) {
                     border-right: 1px solid @text3;
                 }
+                border: 1px solid @text3;
                 i {
                     // background-color: #fff;
                 }
@@ -201,10 +258,9 @@ export default {
         line-height: 24px;
     }
     // background-color: @bg3;;
-    padding-bottom: 100px;
+    padding-bottom: 280px;
     .title {
-        font-size: 20px;
-        font-weight: bold;
+        font-size: 14px;
         color: @text0;
         line-height: 30px;
         margin-top: 5px;
@@ -276,19 +332,55 @@ export default {
     }
     .content {
         width: 375px;
-        height: 70px;
-        line-height: 70px;
         background: @bg;
+
+        .title {
+            span {
+                font-size: 12px;
+                color: #ff4f50;
+            }
+        }
+
+        .van-cell {
+            padding: 0 16px 0px;
+            margin: 10px 0 0;
+
+            /deep/.van-cell__value {
+                background-color: @bg3;
+                padding: 8px;
+            }
+        }
+
+        .info-item {
+            padding: 3px 16px;
+            .flex();
+            justify-content: space-between;
+            font-size: 12px;
+            color: #939599;
+            line-height: 24px;
+
+            .val {
+                border: 1px solid #f5f7fa;
+                box-sizing: border-box;
+                text-align: center;
+                min-width: 72px;
+                display: inline-block;
+
+                &.prim {
+                    color: @prim;
+                }
+            }
+        }
     }
     .input {
-        margin-top: 20px;
+        // margin-top: 20px;
         width: 100%;
         .text1 {
             font-size: @font2;
             color: @text0;
             line-height: 24px;
             margin-bottom: 6px;
-            text-align: center;
+            padding: 0 16px;
         }
         .text2 {
             font-size: @font2;
@@ -308,4 +400,22 @@ export default {
         }
     }
 }
+
+/deep/.van-stepper {
+    padding: 10px 16px;
+    width: 100%;
+    box-sizing: border-box;
+    .van-stepper__input {
+        width: 100%;
+        height: 40px;
+        margin: 0 0;
+    }
+}
+
+.van-notice-bar {
+    font-size: 12px;
+    height: 36px;
+    line-height: 36px;
+    background: fade(@prim, 10%) !important;
+}
 </style>

+ 41 - 2
src/views/user/Address.vue

@@ -1,7 +1,17 @@
 <template>
     <div class="address">
         <div class="title">我的地址</div>
-        <van-address-list :switchable="false" :list="list" default-tag-text="默认" @add="onAdd" @edit="onEdit" />
+        <van-address-list
+            :class="{ emptyList: empty }"
+            :switchable="false"
+            :list="list"
+            default-tag-text="默认"
+            @add="onAdd"
+            @edit="onEdit"
+        />
+        <van-empty :image="require('@assets/kong_png_wudizhi.png')" v-if="empty" description="你还没有收货地址哦~">
+            <van-button @click="onAdd" round type="primary" class="bottom-button">新增地址</van-button>
+        </van-empty>
     </div>
 </template>
 <script>
@@ -22,9 +32,27 @@ export default {
                     tel: '1310000000',
                     address: '浙江省杭州市拱墅区莫干山路 50 号'
                 }
-            ]
+            ],
+            empty: false
         };
     },
+    mounted() {
+        this.$http
+            .post(
+                '/userAddress/all',
+                {
+                    query: {
+                        userId: this.$store.state.userInfo.id
+                    },
+                    size: 99
+                },
+                { body: 'json' }
+            )
+            .then(res => {
+                this.empty = res.empty;
+                this.list = res.content;
+            });
+    },
     methods: {
         onAdd() {
             this.$router.push('/mineAddressEdit');
@@ -70,4 +98,15 @@ export default {
         font-weight: bold;
     }
 }
+
+.bottom-button {
+    width: 280px;
+    height: 38px;
+}
+
+/deep/.emptyList {
+    .van-address-list__bottom {
+        display: none;
+    }
+}
 </style>

+ 10 - 2
src/views/user/AddressEdit.vue

@@ -2,7 +2,6 @@
     <div class="address">
         <van-address-edit
             :area-list="areaList"
-            show-delete
             show-set-default
             show-search-result
             :tel-validator="val => phonePattern.test(val)"
@@ -11,6 +10,7 @@
             @save="onSave"
             @delete="onDelete"
             @change-detail="onChangeDetail"
+            :show-delete="isEdit"
         />
     </div>
 </template>
@@ -23,9 +23,17 @@ export default {
     data() {
         return {
             searchResult: [],
-            areaList
+            areaList,
+            isEdit: false
         };
     },
+    mounted() {
+        if (this.$route.query.id) {
+            this.isEdit = true;
+        } else {
+            this.isEdit = false;
+        }
+    },
     methods: {
         onSave(content) {
             this.$toast.loading({