完善未完成功能:修复关注列表/评论发布/编辑器草稿等页面
This commit is contained in:
+133
-106
@@ -53,126 +53,153 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onMounted, onPullDownRefresh } from 'vue'
|
||||
import { store } from '@/pages3/uni_modules/uni-id-pages/common/store.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pool: 0,
|
||||
extract: '',
|
||||
service_fee: 0.0,
|
||||
showModal: false,
|
||||
is_out: false,
|
||||
is_lowest: false,
|
||||
is_post: false,
|
||||
lowest: 0,
|
||||
fee: 0,
|
||||
money: '',
|
||||
real_money: '',
|
||||
keyboradShow: false,
|
||||
isIphoneX: false,
|
||||
isRefuse: false,
|
||||
content: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
extract(oldVal, newVal) {}
|
||||
},
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
// this.initData();
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
async initData() {
|
||||
// const res = await this.$api.mock('pool');
|
||||
this.lowest = res.least_money;
|
||||
this.fee = res.fee;
|
||||
this.pool = res.pool;
|
||||
this.$nextTick(() => {
|
||||
this.keyboradShow = true;
|
||||
});
|
||||
},
|
||||
stopKeyborad() {
|
||||
uni.hideKeyboard();
|
||||
},
|
||||
keyboradKey(key) {
|
||||
this.extract = this.extract * 10 + key;
|
||||
this.checkMoney();
|
||||
},
|
||||
keyboradDel() {
|
||||
if (this.extract && this.extract > 0) {
|
||||
let val = parseInt(this.extract / 10);
|
||||
if (val == 0) val = '';
|
||||
this.extract = val;
|
||||
this.checkMoney();
|
||||
setup() {
|
||||
const pool = ref(0)
|
||||
const extract = ref('')
|
||||
const service_fee = ref(0.0)
|
||||
const showModal = ref(false)
|
||||
const is_out = ref(false)
|
||||
const is_lowest = ref(false)
|
||||
const is_post = ref(false)
|
||||
const lowest = ref(1)
|
||||
const fee = ref(0)
|
||||
const money = ref('')
|
||||
const real_money = ref('')
|
||||
const keyboradShow = ref(true)
|
||||
const isIphoneX = ref(false)
|
||||
const isRefuse = ref(false)
|
||||
const content = ref("")
|
||||
|
||||
onMounted(() => {
|
||||
uni.showLoading({ title: '加载中' })
|
||||
initData()
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 500)
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
extract.value = ''
|
||||
is_out.value = false
|
||||
is_lowest.value = false
|
||||
is_post.value = false
|
||||
initData()
|
||||
setTimeout(() => {
|
||||
uni.stopPullDownRefresh()
|
||||
}, 500)
|
||||
})
|
||||
|
||||
function initData() {
|
||||
const info = store.userInfo || {}
|
||||
pool.value = Number(info.available) || 0
|
||||
lowest.value = 1
|
||||
fee.value = 0
|
||||
keyboradShow.value = true
|
||||
}
|
||||
|
||||
function stopKeyborad() {
|
||||
uni.hideKeyboard()
|
||||
}
|
||||
|
||||
function keyboradKey(key) {
|
||||
extract.value = extract.value * 10 + key
|
||||
checkMoney()
|
||||
}
|
||||
|
||||
function keyboradDel() {
|
||||
if (extract.value && extract.value > 0) {
|
||||
let val = parseInt(extract.value / 10)
|
||||
if (val === 0) val = ''
|
||||
extract.value = val
|
||||
checkMoney()
|
||||
}
|
||||
},
|
||||
getAll() {
|
||||
this.extract = parseInt(this.pool);
|
||||
this.checkMoney();
|
||||
},
|
||||
checkMoney() {
|
||||
if (!this.extract || this.extract < this.lowest) {
|
||||
this.is_lowest = true;
|
||||
this.is_post = false;
|
||||
} else if (this.extract > this.pool) {
|
||||
this.is_out = true;
|
||||
this.is_lowest = false;
|
||||
this.is_post = false;
|
||||
}
|
||||
|
||||
function getAll() {
|
||||
extract.value = parseInt(pool.value)
|
||||
checkMoney()
|
||||
}
|
||||
|
||||
function checkMoney() {
|
||||
if (!extract.value || extract.value < lowest.value) {
|
||||
is_lowest.value = true
|
||||
is_post.value = false
|
||||
} else if (extract.value > pool.value) {
|
||||
is_out.value = true
|
||||
is_lowest.value = false
|
||||
is_post.value = false
|
||||
} else {
|
||||
this.is_out = false;
|
||||
this.is_lowest = false;
|
||||
this.is_post = true;
|
||||
is_out.value = false
|
||||
is_lowest.value = false
|
||||
is_post.value = true
|
||||
}
|
||||
if (parseFloat(this.extract).toString() == 'NaN') {
|
||||
this.is_post = false;
|
||||
this.$api.msg('输入金额不合法');
|
||||
if (parseFloat(extract.value).toString() === 'NaN') {
|
||||
is_post.value = false
|
||||
}
|
||||
},
|
||||
handleShowModel() {
|
||||
if (this.isRefuse) return;
|
||||
this.checkMoney();
|
||||
if (!this.is_post) return;
|
||||
this.money = this.extract;
|
||||
this.service_fee = Number((this.extract * (this.fee / 100)).toString().match(/^\d+(?:\.\d{0,2})?/));
|
||||
this.real_money = Number((this.extract - this.service_fee).toString().match(/^\d+(?:\.\d{0,2})?/));
|
||||
this.content = `<p>提现金额:<em style="font-style:normal;color:#ff1e0f">${this.money} 元</p>
|
||||
<p>实际到账:<em style="font-style:normal;color:#ff1e0f">${this.real_money} 元</em></p>
|
||||
<p>服务费用:<em style="font-style:normal;color:#ff1e0f">${this.service_fee} 元</em></p>
|
||||
<p>服务费率:<em style="font-style:normal;color:#ff1e0f">${this.fee}%</em></p>
|
||||
}
|
||||
|
||||
function handleShowModel() {
|
||||
if (isRefuse.value) return
|
||||
checkMoney()
|
||||
if (!is_post.value) return
|
||||
money.value = extract.value
|
||||
service_fee.value = Number((extract.value * (fee.value / 100)).toString().match(/^\d+(?:\.\d{0,2})?/))
|
||||
real_money.value = Number((extract.value - service_fee.value).toString().match(/^\d+(?:\.\d{0,2})?/))
|
||||
content.value = `<p>提现金额:<em style="font-style:normal;color:#ff1e0f">${money.value} 元</p>
|
||||
<p>实际到账:<em style="font-style:normal;color:#ff1e0f">${real_money.value} 元</em></p>
|
||||
<p>服务费用:<em style="font-style:normal;color:#ff1e0f">${service_fee.value} 元</em></p>
|
||||
<p>服务费率:<em style="font-style:normal;color:#ff1e0f">${fee.value}%</em></p>
|
||||
`
|
||||
this.showModal = true;
|
||||
},
|
||||
getMoney() {
|
||||
this.showModal = false;
|
||||
if (this.isRefuse) return;
|
||||
this.isRefuse = true;
|
||||
showModal.value = true
|
||||
}
|
||||
|
||||
function getMoney() {
|
||||
showModal.value = false
|
||||
if (isRefuse.value) return
|
||||
isRefuse.value = true
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: "提现申请已提交,等待审核",
|
||||
mask: false,
|
||||
icon: 'none'
|
||||
});
|
||||
}, 500);
|
||||
})
|
||||
}, 500)
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
return {
|
||||
pool,
|
||||
extract,
|
||||
service_fee,
|
||||
showModal,
|
||||
is_out,
|
||||
is_lowest,
|
||||
is_post,
|
||||
lowest,
|
||||
fee,
|
||||
money,
|
||||
real_money,
|
||||
keyboradShow,
|
||||
isIphoneX,
|
||||
isRefuse,
|
||||
content,
|
||||
initData,
|
||||
stopKeyborad,
|
||||
keyboradKey,
|
||||
keyboradDel,
|
||||
getAll,
|
||||
checkMoney,
|
||||
handleShowModel,
|
||||
getMoney
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.extract = '';
|
||||
// this.initData();
|
||||
this.is_out = false;
|
||||
this.is_lowest = false;
|
||||
this.is_post = false;
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user