| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <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>
- </div>
- <div class="border border1"></div>
- <div class="content">
- <van-field type="number" label="寄售价格(元)" placeholder="请设置寄售价格" v-model="price" />
- </div>
- <div class="border"></div>
- <div class="input">
- <div class="text1">请输入交易密码,验证信息</div>
- <div v-if="sets">
- <van-password-input :value="password" :focused="showKeyboard" @focus="showKeyboard = true" />
- <van-number-keyboard
- v-model="password"
- :show="showKeyboard"
- @blur="showKeyboard = false"
- maxlength="6"
- />
- <div class="text2" @click="$router.push('/tradingPassword')">忘记密码?</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>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex';
- export default {
- name: 'Top',
- data() {
- return {
- price: '',
- showKeyboard: false,
- password: '',
- sets: false,
- list: [
- {
- title: '1. 作品寄售为单个作品价格'
- },
- {
- title: '2. 用户将会看到加密作品的权益、加密空间的使用情况'
- },
- {
- title: '3. 交易成功后加密作品的点赞数量将会被清除'
- },
- {
- title: '4. 平台会收取作品出售价格的 5% 作为服务费'
- },
- {
- title: '5. 因电子支付通道限制,单笔限额20000元'
- }
- ]
- };
- },
- computed: {
- ...mapState(['userInfo'])
- },
- mounted() {
- this.passFn();
- },
- methods: {
- passFn() {
- this.$http
- .get('/user/tradeCodeStatus', {
- userId: this.userInfo.id
- })
- .then(res => {
- console.log(res);
- this.sets = res.set;
- });
- },
- submit() {
- if (this.price != '') {
- this.$http
- .post('/user/verifyTradeCode', {
- tradeCode: this.password
- })
- .then(() => {
- this.$http
- .post('/asset/consignment', {
- id: this.$route.query.id,
- price: this.price
- })
- .then(res => {
- this.$toast.success('寄售成功');
- setTimeout(() => {
- this.$router.go(-1);
- }, 1000);
- })
- .catch(e => {
- if (e) {
- this.$toast.success(e.error);
- }
- });
- })
- .catch(e => {
- if (e) {
- this.$toast('密码错误');
- }
- });
- } else {
- this.$toast('请输入价格');
- }
- }
- }
- };
- </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: 20px 0;
- .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: 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-cell {
- padding-top: 20px;
- }
- /deep/.van-cell__title {
- font-size: @font2;
- font-weight: bold;
- color: @text0;
- line-height: 24px;
- }
- // background-color: @bg3;;
- padding-bottom: 100px;
- .title {
- font-size: 20px;
- font-weight: bold;
- color: @text0;
- line-height: 30px;
- margin-top: 5px;
- padding-left: 16px;
- }
- .name {
- padding-left: 16px;
- span {
- font-size: 12px;
- font-weight: 400;
- color: @text3;
- line-height: 22px;
- }
- }
- .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: 161px;
- height: 44px;
- border-radius: 22px;
- line-height: 44px;
- color: @text3;
- text-align: center;
- border: 1px solid @text3;
- }
- .btn2 {
- width: 162px;
- 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;
- }
- }
- .content {
- width: 375px;
- height: 70px;
- line-height: 70px;
- background: @bg;
- }
- .input {
- margin-top: 20px;
- width: 100%;
- .text1 {
- font-size: @font2;
- color: @text0;
- line-height: 24px;
- margin-bottom: 6px;
- text-align: center;
- }
- .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;
- }
- }
- }
- </style>
|