| | |
| | | </div> |
| | | </div> |
| | | <div class="pt-30 pb-20"> |
| | | <div class="flex"> |
| | | <div class="flex justify-between"> |
| | | <div class="w-440 flex flex-col"> |
| | | <template v-if="selectIndex == 1"> |
| | | <div class="flex items-center h-66 rounded-lg text-grey"> |
| | | <div class="flex items-center h-66 greyBg textColor"> |
| | | <p class="font-28 flex-1 flex items-center justify-center h-66 " |
| | | :class="currentType == 'long' ? 'long' : ''" @click="changeTab('long')"> |
| | | {{ $t("开多") }} |
| | |
| | | </p> |
| | | </div> |
| | | <div class="mt-22 mb-30" style="position:relative;"> |
| | | <div class="greyBg flex justify-between items-center w-full h-76 rounded-lg textColor" |
| | | @click="selectBtn"> |
| | | <div class="greyBg flex justify-between items-center w-full h-76 greyBg textColor" @click="selectBtn"> |
| | | <img src="../../../assets/image/public/warn.png" alt="warn-icon" class="w-25 h-25 ml-20" /> |
| | | <div class="text-center" style="width:80%;">{{ title }}</div> |
| | | <img src="../../../assets/image/public/grey-select.png" alt="select-icon" class="w-22 h-11 mr-20" /> |
| | |
| | | </template> |
| | | <contract-futrue v-if="selectIndex == 2 && JSON.stringify(initFutrue.para) != '[]'" class="mb-20" |
| | | :initFutrue="initFutrue" @paraId="onParaId" /> |
| | | <div class="h-76 lh-76 greyBg mb-30 flex pr-20 justify-center rounded-lg textColor" v-if="selectIndex == 1"> |
| | | <div class="h-76 lh-76 greyBg mb-30 flex pr-20 justify-center greyBg textColor" v-if="selectIndex == 1"> |
| | | <input placeholder="" class="greyBg w-full pl-20 h-76 border-none text-left rounded-lg" |
| | | :disabled="type / 1 === 1" @focus="focus = true" v-model="form.price" /> |
| | | <span class="ml-20">{{ queryType === 'cryptos' ? 'USDT' : 'USD' }}</span> |
| | | </div> |
| | | |
| | | <div class="w-440 h-76" v-if="selectIndex == 2"></div> |
| | | <div class="w-440 flex items-center greyBg h-76 lh-76 pr-5 pl-5 rounded-lg" v-if="initFutrue"> |
| | | <div class="w-440 flex items-center greyBg h-76 lh-76 pr-5 pl-5 greyBg" v-if="initFutrue"> |
| | | <div v-if="selectIndex == 1 && initFutrue.para && initFutrue.para.length > 0" |
| | | class="w-80 flex items-center justify-center" style="height:100%;" @click="onReduce"> |
| | | <img src="../../../assets/image/public/reduce.png" alt="add" class="w-30 h-6" /> |
| | |
| | | <!-- 张数输入 --> |
| | | <!-- <amount-slider ref="sliderRef" :maxAmount="maxUSDT" @getAmount="getAmount" |
| | | :propsAmount="form.amount"></amount-slider> --> |
| | | <div class="btns_box" > |
| | | <div :class="bfbindex==index?'btns_box_boxs':'btns_box_box'" @click="bfbclick(item,index)" v-for="(item,index) in bfblist" :key="index">{{item.name}}%</div> |
| | | </div> |
| | | <div class="btns_box"> |
| | | <div :class="bfbindex == index ? 'btns_box_boxs' : 'btns_box_box'" @click="bfbclick(item, index)" |
| | | v-for="(item, index) in bfblist" :key="index">{{ item.name }}%</div> |
| | | </div> |
| | | </template> |
| | | <template v-if="selectIndex == 1 && userInfo.token"> |
| | | <div class="flex justify-between mt-30"> |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <div class="flex font-24 text-grey justify-between mt-32" > |
| | | <div class="flex font-24 text-grey justify-between mt-32"> |
| | | <div>{{ $t("可用USDT") }}</div> |
| | | <div class="textColor">{{ initFutrue.amount }} USDT</div> |
| | | </div> |
| | |
| | | |
| | | <template v-if="userInfo.token"> |
| | | <template v-if="selectIndex == 1"> |
| | | <div class="w-full h-80 lh-80 bg-green flex text-white rounded-ban mt-70" v-if="currentType == 'long'" |
| | | <div class="w-full h-80 lh-80 bg-green flex text-white mt-70" v-if="currentType == 'long'" |
| | | @click="order('long')"> |
| | | <div class="font-34 relative text-center" style="flex-grow:1;" v-if="selectIndex == 1"> |
| | | {{ $t('开多') }} |
| | |
| | | {{ $t('做多买入') }} |
| | | </div> |
| | | </div> |
| | | <div class="w-full h-80 lh-80 bg-red flex text-white rounded-ban mt-70" v-if="currentType == 'short'" |
| | | <div class="w-full h-80 lh-80 bg-red flex text-white mt-70" v-if="currentType == 'short'" |
| | | @click="order('short')"> |
| | | <div class="relative font-34 text-center" style="flex-grow:1;" v-if="selectIndex == 1"> |
| | | {{ $t('开空') }} |
| | |
| | | </div> |
| | | </template> |
| | | <template v-if="selectIndex == 2"> |
| | | <div class="w-full h-80 lh-80 bg-green flex text-white rounded-ban mt-10 " @click="order('open')" |
| | | <div class="w-full h-80 lh-80 bg-green flex text-white mt-10 " @click="order('open')" |
| | | v-if="userInfo.token"> |
| | | <div class="font-34 relative text-center" style="flex-grow: 1"> |
| | | {{ $t("开多") }} |
| | |
| | | }}</span> --> |
| | | </div> |
| | | </div> |
| | | <div class="w-full h-80 lh-80 bg-red flex text-white rounded-ban mt-20 mb-10" |
| | | style="position: relative;" :class="{ 'mt-22': selectIndex == 2 }" @click="order('close')" |
| | | v-if="userInfo.token"> |
| | | <div class="w-full h-80 lh-80 bg-red flex text-white mt-20 mb-10" style="position: relative;" |
| | | :class="{ 'mt-22': selectIndex == 2 }" @click="order('close')" v-if="userInfo.token"> |
| | | <div class="relative font-34 text-center" style="flex-grow: 1"> |
| | | {{ $t("开空") }} |
| | | <!-- <span class="right-word font-22 text-center">{{ |
| | |
| | | {{ $t('logIn') }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="ml-30"> |
| | | <div> |
| | | <div class="w-290 flex justify-between text-grey font-22"> |
| | | <div> |
| | | <div>{{ $t("价格") }}</div> |
| | |
| | | '%,rgba(246,70,93,.1) 100%)', |
| | | }"> --> |
| | | |
| | | <div v-show="(showType == 0 || showType == 2) " class="w-290 flex justify-between pt-1 font-26" |
| | | <div v-show="(showType == 0 || showType == 2)" class="w-290 flex justify-between pt-1 font-26" |
| | | v-for="(item, index) in redData" :key="item + index" @click="onQuickPrice(item.price)" :style="{ |
| | | background: |
| | | `linear-gradient(to right,${THEME == 'dark' ? '#131A2E' : '#fff' |
| | | `linear-gradient(to right,${$store.state.vant.theme == 'dark' ? '#131A2E' : '#fff' |
| | | } 0%` + |
| | | (1 - item.amount / greenData[greenData.length - 1].amount) * |
| | | 100 + |
| | |
| | | <div v-if="showType == 0 || showType == 1" class="w-290 flex justify-between pt-1 font-26" |
| | | v-for="(item, index) in greenData" :key="index" @click="onQuickPrice(item.price)" :style="{ |
| | | background: |
| | | `linear-gradient(to right,${THEME == 'dark' ? '#131A2E' : '#fff' |
| | | `linear-gradient(to right,${$store.state.vant.theme == 'dark' ? '#131A2E' : '#fff' |
| | | } 0%` + |
| | | (1 - item.amount / greenData[greenData.length - 1].amount) * |
| | | 100 + |
| | |
| | | return { |
| | | THEME, |
| | | fixDate, |
| | | bfbindex:null, |
| | | bfblist:[ |
| | | {name:'25'}, |
| | | {name:'50'}, |
| | | {name:'75'}, |
| | | {name:'100'} |
| | | ], |
| | | bfbindex: null, |
| | | bfblist: [ |
| | | { name: '25' }, |
| | | { name: '50' }, |
| | | { name: '75' }, |
| | | { name: '100' } |
| | | ], |
| | | currentBuyType: '', // 交割合约当前下单的类型,用于弹窗倒计时结束以后,点击再下一单 |
| | | timeout2: null, |
| | | timeout: null, |
| | |
| | | }, |
| | | methods: { |
| | | reserve, |
| | | bfbclick(e,i){ |
| | | this.bfbindex = i |
| | | e = parseInt(e.name) |
| | | const rate = e / 100; //如0.25 |
| | | this.form.amount = this.maxUSDT * rate |
| | | var a = this.form.amount |
| | | this.form.amount = Math.floor(a*100)/100 |
| | | }, |
| | | bfbclick(e, i) { |
| | | this.bfbindex = i |
| | | e = parseInt(e.name) |
| | | const rate = e / 100; //如0.25 |
| | | this.form.amount = this.maxUSDT * rate |
| | | var a = this.form.amount |
| | | this.form.amount = Math.floor(a * 100) / 100 |
| | | }, |
| | | //获取张数 |
| | | getAmount(val) { |
| | | if (!val) { |
| | |
| | | |
| | | <style lang="scss"> |
| | | @import "@/assets/init.scss"; |
| | | .btns_box_boxs{ |
| | | width: 23%; |
| | | border: 1px solid #F7B600; |
| | | text-align: center; |
| | | border-radius: 10px; |
| | | color: #F7B600; |
| | | |
| | | .btns_box_boxs { |
| | | width: 23%; |
| | | border: 1px solid #F7B600; |
| | | text-align: center; |
| | | border-radius: 10px; |
| | | color: #F7B600; |
| | | } |
| | | .btns_box_box{ |
| | | width: 23%; |
| | | border: 1px solid #cbcbcb; |
| | | text-align: center; |
| | | border-radius: 10px; |
| | | |
| | | .btns_box_box { |
| | | width: 23%; |
| | | border: 1px solid #cbcbcb; |
| | | text-align: center; |
| | | border-radius: 10px; |
| | | } |
| | | .btns_box{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .btns_box { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | #cryptos { |
| | | .perpetual-open { |
| | | font-size: 26px; |
| | |
| | | right: 0; |
| | | top: 90px; |
| | | width: 100%; |
| | | background-color: $grey_bg; |
| | | // background-color: $grey_bg; |
| | | text-align: center; |
| | | box-shadow: 0px 0px 3px 3px $grey_bg; |
| | | // box-shadow: 0px 0px 3px 3px $grey_bg; |
| | | border-radius: 4px; |
| | | color: $text-color; |
| | | // color: $text-color; |
| | | z-index: 10; |
| | | |
| | | @include themify() { |
| | | background: themed("input_background"); |
| | | color: themed("text_color"); |
| | | box-shadow: 0px 0px 3px 3px themed("input_background"); |
| | | } |
| | | } |
| | | |
| | | .option-box>div { |
| | |
| | | } |
| | | |
| | | .long { |
| | | background-color: $green; |
| | | background: url(@/assets/image/public/open-bg.png) no-repeat right center; |
| | | background-size: 100% 100%; |
| | | // background-color: $green; |
| | | // background: url(@/assets/image/public/open-bg.png) no-repeat right center; |
| | | // background-size: 100% 100%; |
| | | color: white; |
| | | |
| | | background: #06CDA5; |
| | | // border-radius: 5rem; |
| | | } |
| | | |
| | | .short { |
| | | background-color: $green; |
| | | background: url(@/assets/image/public/close-bg.png) no-repeat left center; |
| | | background-size: 100% 100%; |
| | | // background-color: $green; |
| | | // background: url(@/assets/image/public/close-bg.png) no-repeat left center; |
| | | // background-size: 100% 100%; |
| | | color: white; |
| | | |
| | | background: #F43368; |
| | | // border-radius: 5rem; |
| | | } |
| | | |
| | | .van-action-sheet__content { |
| | |
| | | |
| | | .select-box { |
| | | width: 220px; |
| | | border-radius: 2.5rem; |
| | | background: #1E1E1E; |
| | | |
| | | // border-radius: 2.5rem; |
| | | // background: #1E1E1E; |
| | | margin-right: 20px; |
| | | |
| | | @include themify() { |
| | | background: themed("input_background"); |
| | | } |
| | | } |
| | | } |
| | | |