|
|
@@ -0,0 +1,590 @@
|
|
|
+<template>
|
|
|
+ <div class="top">
|
|
|
+ <div class="top-content">
|
|
|
+ <div class="title">拍卖说明</div>
|
|
|
+ <div class="name" v-for="(item, index) in list" :key="index">
|
|
|
+ <span>{{ item.title }}</span>
|
|
|
+ <span class="prim">{{ item.sub }}</span>
|
|
|
+ <span>{{ item.text1 }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="border border1"></div>
|
|
|
+ <div class="box-content">
|
|
|
+ <div class="title">请选择拍卖模式</div>
|
|
|
+ <div class="box-select">
|
|
|
+ <div class="select-item prim" @click="warning">
|
|
|
+ <span>一口价模式</span>
|
|
|
+ <img src="../../assets/icon_gouxuan_pre.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="select-item" @click="showStarting = !showStarting" :class="{ prim: showStarting }">
|
|
|
+ <span>竞拍模式</span>
|
|
|
+ <img v-if="showStarting" src="../../assets/icon_gouxuan_pre.png" alt="" />
|
|
|
+ <img v-else src="../../assets/icon_gouxuan_huise.png" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="box">
|
|
|
+ <div class="content">
|
|
|
+ <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"
|
|
|
+ allow-empty
|
|
|
+ min="0"
|
|
|
+ max="20000"
|
|
|
+ placeholder="请输入价格"
|
|
|
+ @change="agreement = false"
|
|
|
+ />
|
|
|
+ <div class="title">预计收入(元)</div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span>寄售定价</span>
|
|
|
+ <span class="val">{{ price1 }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span>版税({{ info.royalties || 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>
|
|
|
+ <div class="box" v-if="showStarting">
|
|
|
+ <div class="content">
|
|
|
+ <div class="title">竞拍模式(元)<span>最高定价20000.00</span></div>
|
|
|
+ <!-- <van-field type="number" input-align="center" placeholder="请输入价格" v-model="price" /> -->
|
|
|
+ <van-stepper
|
|
|
+ v-model="startingPrice"
|
|
|
+ :default-value="''"
|
|
|
+ :show-plus="false"
|
|
|
+ :show-minus="false"
|
|
|
+ :decimal-length="2"
|
|
|
+ allow-empty
|
|
|
+ min="0"
|
|
|
+ max="20000"
|
|
|
+ placeholder="请输入起拍价"
|
|
|
+ @change="agreement = false"
|
|
|
+ />
|
|
|
+ <div class="title">竞拍说明</div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span>拍卖类型</span>
|
|
|
+ <span class="val">增价拍</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span>加价幅度</span>
|
|
|
+ <span class="val">¥100</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span>保证金</span>
|
|
|
+ <span class="val">¥100</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="border"></div>
|
|
|
+ <div class="input">
|
|
|
+ <div class="text1">请输入交易密码</div>
|
|
|
+ <div v-if="sets">
|
|
|
+ <van-password-input :gutter="10" :value="password" :focused="showKeyboard" @focus="keyboardEnter" />
|
|
|
+ <van-number-keyboard
|
|
|
+ v-model="password"
|
|
|
+ :show="showKeyboard"
|
|
|
+ @blur="keyBlur"
|
|
|
+ :gutter="10"
|
|
|
+ maxlength="6"
|
|
|
+ theme="custom"
|
|
|
+ close-button-text="完成"
|
|
|
+ random-key-order
|
|
|
+ />
|
|
|
+ <div class="text2-content">
|
|
|
+ <div class="text2" @click="goRouter">忘记密码?</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="text3" @click="$router.push('/tradingPassword')">您当前没有交易密码,点击去设置</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bottom van-safe-area-bottom" ref="bottom">
|
|
|
+ <van-notice-bar
|
|
|
+ :color="$colors.prim"
|
|
|
+ :background="$colors.prim"
|
|
|
+ text="出售成功的数字藏品将会携带数字藏品的所有信息转让于购买方,包括但不限于:权益的使用、数字藏品的区块信息等"
|
|
|
+ />
|
|
|
+ <div class="bottom-content">
|
|
|
+ <div class="btn1" @click="$router.go(-1)">取消</div>
|
|
|
+ <div class="btn2" @click="submit">确认拍卖</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="border"></div>
|
|
|
+ <agreement ref="agree" :info="info" @agree="agree"></agreement>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState } from 'vuex';
|
|
|
+import Agreement from './Agreement.vue';
|
|
|
+export default {
|
|
|
+ components: { Agreement },
|
|
|
+ name: 'Top',
|
|
|
+ inject: ['changeScroll'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ price: '',
|
|
|
+ startingPrice: '',
|
|
|
+ showStarting: false,
|
|
|
+ showKeyboard: false,
|
|
|
+ password: '',
|
|
|
+ sets: false,
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ title: '1. 拍卖时间默认为5天',
|
|
|
+ sub: '(期间不可下架,修改)'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '2 拍卖价格为单个作品价格'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '3. 用户将会看到数字权益的使用情况'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '4. 交易成功后数字藏品的点赞数量,拍卖纪录将会被清除'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '5. 平台会收取作品出售价格的',
|
|
|
+ sub: ' 5% ',
|
|
|
+ text1: '作为服务费'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '6. 因电子支付通道限制,单笔限额20000元'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ info: {},
|
|
|
+ agreement: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['userInfo']),
|
|
|
+ price1() {
|
|
|
+ let price = Math.floor(this.price * 100) / 100;
|
|
|
+ return price.toFixed(2);
|
|
|
+ },
|
|
|
+ price2() {
|
|
|
+ let price = Math.floor(this.price * (this.info.royalties || 0)) / 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 * (95 - (this.info.royalties || 0))) / 100;
|
|
|
+ return price.toFixed(2);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.passFn();
|
|
|
+ this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
|
|
|
+ this.info = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ keyboardEnter() {
|
|
|
+ this.changeScroll(1000);
|
|
|
+ this.showKeyboard = true;
|
|
|
+ },
|
|
|
+ passFn() {
|
|
|
+ this.$http
|
|
|
+ .get('/user/tradeCodeStatus', {
|
|
|
+ userId: this.userInfo.id
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.sets = res.set;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ agree() {
|
|
|
+ this.agreement = true;
|
|
|
+ this.submit();
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ if (this.showStarting && !Number(this.startingPrice)) {
|
|
|
+ this.$toast('请输入起拍价');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number(this.price)) {
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '寄售',
|
|
|
+ message: `商品将以<span style='color:#ff4f50;font-weight:bold;font-size:18px;margin:0 5px'>${this.price}</span>的价格上架`,
|
|
|
+ allowHtml: true
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$http
|
|
|
+ .post('/user/verifyTradeCode', {
|
|
|
+ tradeCode: this.password
|
|
|
+ })
|
|
|
+ .then(_ => resolve())
|
|
|
+ .catch(e => {
|
|
|
+ reject({ error: '密码错误' });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return this.$http.post('/asset/consignment', {
|
|
|
+ sellerId: this.userInfo.id
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ if (e.error) {
|
|
|
+ this.$toast(e.error || '出现错误,请稍后再试');
|
|
|
+ }
|
|
|
+ return Promise.reject('cancel');
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$toast.success('寄售成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.go(-1);
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ if (e && e.error) {
|
|
|
+ this.$toast(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$toast('请输入一口价');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goRouter() {
|
|
|
+ if (!this.showKeyboard) {
|
|
|
+ this.$router.push('/tradingPassword');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ keyBlur() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.showKeyboard = false;
|
|
|
+ }, 100);
|
|
|
+ },
|
|
|
+ warning() {
|
|
|
+ this.$dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '一口价模式为必选项,不可取消'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+/deep/ .van-notice-bar {
|
|
|
+ background: rgba(255, 108, 0, 0.1) !important;
|
|
|
+}
|
|
|
+/deep/ .van-password-input {
|
|
|
+ margin: 0 0;
|
|
|
+ .van-password-input__security {
|
|
|
+ border: 1px solid @text3;
|
|
|
+ height: 42px;
|
|
|
+ border-radius: 2px;
|
|
|
+ li {
|
|
|
+ background-color: transparent;
|
|
|
+ &:not(:last-child) {
|
|
|
+ border-right: 1px solid @text3;
|
|
|
+ }
|
|
|
+ i {
|
|
|
+ // background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.van-number-keyboard__body {
|
|
|
+ background-color: fade(#4a4a4a, 50%);
|
|
|
+ .van-key {
|
|
|
+ background-color: @bg;
|
|
|
+ &:active {
|
|
|
+ background-color: @bg3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.input {
|
|
|
+ padding: 12px 0 20px;
|
|
|
+ .text1 {
|
|
|
+ font-size: @font2;
|
|
|
+ color: @text0;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.top-content {
|
|
|
+ background-color: @bg;
|
|
|
+ padding-top: 10px;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ background-color: @bg3;
|
|
|
+ /deep/ .van-password-input {
|
|
|
+ margin: 10px 0;
|
|
|
+ padding: 0 25px;
|
|
|
+ .van-password-input__security {
|
|
|
+ border-width: 0;
|
|
|
+ height: 42px;
|
|
|
+ border-radius: 2px;
|
|
|
+ li {
|
|
|
+ background-color: transparent;
|
|
|
+ &:not(:last-child) {
|
|
|
+ border-right: 1px solid @text3;
|
|
|
+ }
|
|
|
+ border: 1px solid @text3;
|
|
|
+ i {
|
|
|
+ // background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /deep/ .van-cell {
|
|
|
+ padding-top: 20px;
|
|
|
+ }
|
|
|
+ /deep/.van-cell__title {
|
|
|
+ font-size: @font2;
|
|
|
+ font-weight: bold;
|
|
|
+ color: @text0;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ // background-color: @bg3;;
|
|
|
+ padding-bottom: 280px;
|
|
|
+ .title {
|
|
|
+ font-size: 14px;
|
|
|
+ color: @text0;
|
|
|
+ // line-height: 30px;
|
|
|
+ margin-top: 5px;
|
|
|
+ padding: 5px 16px 5px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .name {
|
|
|
+ padding-left: 16px;
|
|
|
+ span {
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: @text3;
|
|
|
+ line-height: 22px;
|
|
|
+
|
|
|
+ &.prim {
|
|
|
+ color: @prim;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .bottom {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0px;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ background-color: @bg;
|
|
|
+ z-index: 20;
|
|
|
+ border-top: 1px solid @tabBorder;
|
|
|
+
|
|
|
+ .bottom-content {
|
|
|
+ padding: 6px 16px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .btn1 {
|
|
|
+ width: calc(50% - 10px);
|
|
|
+ height: 44px;
|
|
|
+ border-radius: 22px;
|
|
|
+ line-height: 44px;
|
|
|
+ color: @text3;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid @text3;
|
|
|
+ }
|
|
|
+ .btn2 {
|
|
|
+ width: calc(50% - 10px);
|
|
|
+ height: 44px;
|
|
|
+ line-height: 44px;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ color: @btnText;
|
|
|
+ background: linear-gradient(135deg, @prim 0%, @warn 100%);
|
|
|
+ border-radius: 22px;
|
|
|
+ }
|
|
|
+ .van-button {
|
|
|
+ flex-grow: 1;
|
|
|
+ color: #333230 !important;
|
|
|
+ max-width: 210px;
|
|
|
+ }
|
|
|
+ .text {
|
|
|
+ font-size: @font2;
|
|
|
+ color: @text3;
|
|
|
+ line-height: 20px;
|
|
|
+ word-break: keep-all;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .border {
|
|
|
+ // width: 375px;
|
|
|
+ height: 5px;
|
|
|
+ background: @bg3;
|
|
|
+ &.border1 {
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .box {
|
|
|
+ background-color: @bg;
|
|
|
+ padding: 16px 16px 0;
|
|
|
+ border-radius: 4px;
|
|
|
+ &:last-child {
|
|
|
+ padding-bottom: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ // width: 375px;
|
|
|
+ background: @bg3;
|
|
|
+ padding-bottom: 12px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ padding-top: 16px;
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ span {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #ff4f50;
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .van-cell {
|
|
|
+ padding: 0 16px 0px;
|
|
|
+ margin: 10px 0 0;
|
|
|
+
|
|
|
+ /deep/.van-cell__value {
|
|
|
+ background-color: @bg;
|
|
|
+ padding: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-item {
|
|
|
+ padding: 0 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;
|
|
|
+ width: 100%;
|
|
|
+ .text1 {
|
|
|
+ font-size: @font2;
|
|
|
+ color: @text0;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ padding: 0 16px;
|
|
|
+ }
|
|
|
+ .text2 {
|
|
|
+ font-size: @font2;
|
|
|
+ text-align: right;
|
|
|
+ font-weight: 400;
|
|
|
+ color: @text3;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+ .text3 {
|
|
|
+ font-size: @font2;
|
|
|
+ color: #ff4f50;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-top: 25px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.text2-content {
|
|
|
+ .flex();
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+/deep/.van-stepper {
|
|
|
+ padding: 10px 16px;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .van-stepper__input {
|
|
|
+ width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ margin: 0 0;
|
|
|
+ background-color: @bg;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.van-notice-bar {
|
|
|
+ font-size: 12px;
|
|
|
+ height: 36px;
|
|
|
+ line-height: 36px;
|
|
|
+ background: fade(@prim, 10%) !important;
|
|
|
+}
|
|
|
+
|
|
|
+.box-select {
|
|
|
+ .flex();
|
|
|
+ padding: 10px 16px 0;
|
|
|
+ justify-content: space-between;
|
|
|
+ .select-item {
|
|
|
+ width: calc(50% - 10px);
|
|
|
+ .flex();
|
|
|
+ img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ margin-left: 4px;
|
|
|
+ }
|
|
|
+ height: 38px;
|
|
|
+ background: #f5f7fa;
|
|
|
+ border-radius: 2px;
|
|
|
+ border: 1px solid #c8c9cc;
|
|
|
+ justify-content: center;
|
|
|
+ span {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #939599;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.prim {
|
|
|
+ span {
|
|
|
+ color: @prim;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ border-color: @prim;
|
|
|
+ background: rgba(58, 178, 0, 0.04);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|