pull/34/head
落日晚风 2024-01-03 17:49:53 +08:00
parent 70b92c6e98
commit 3c2f3ee716
7 changed files with 129 additions and 117 deletions

View File

@ -1,8 +1,8 @@
<!-- 砍价详情 -->
<template>
<!-- TODO @科举按照项目的代码风格调整下这个界面 -->
<!-- TODO @科举挪到 bargain/detail.vue -->
<!-- TODO @科举尽量都迁移完依赖数据的部分通过直接在 state 写死状态不用后端返回跑通整个界面不追求 100% 但是至少自己观感是 ok -->
<!-- TODO @科举按照项目的代码风格调整下这个界面 -->
<!-- TODO @科举挪到 bargain/detail.vue -->
<!-- TODO @科举尽量都迁移完依赖数据的部分通过直接在 state 写死状态不用后端返回跑通整个界面不追求 100% 但是至少自己观感是 ok -->
<s-layout title='砍价详情'>
<view class='bargain'>
<!-- :class="startBargainUid !== userInfo.uid ? 'on' : ''" -->
@ -138,28 +138,18 @@
});
function getBargainDetails() {
sheep.$api.activity.getBargainActivityDetail({
async function getBargainDetails() {
let {
data,
code
} = await sheep.$api.activity.getBargainActivityDetail({
id: state.id
}).then(res => {
state.bargainInfo = res.data;
state.buyPrice = state.bargainInfo.bargainFirstPrice;
// state.pages = '/pages/activity/goods_bargain_details/index?id=' + state.id +
// '&startBargainUid=' + state.uid + '&scene=' + state.uid + '&storeBargainId=' + state
// .storeBargainId;
// uni.setNavigationBarTitle({
// title: bargainInfo.name.substring(0, 13) + '...'
// })
//
// this.gobargainUserInfo();
//#ifdef H5
// this.getImageBase64(bargainInfo.picUrl);
//#endif
}).catch(function(err) {
//
})
if (code == 0) {
state.bargainInfo = data;
state.buyPrice = state.bargainInfo.bargainFirstPrice;
}
}
onLoad(function(options) {
if (options.hasOwnProperty('id')) {

View File

@ -22,11 +22,10 @@
align-items: center;
"
>
<!-- TODO @科举1这里已签到的样式不太对2最后一天 7 的大奖样式不太对 -->
<view class="item" v-for="(item, index) in state.signConfigList" :key="index">
<view
:class="
(index + 1 === state.signConfigList.length ? 'reward' : '') +
(index === state.signConfigList.length ? 'reward' : '') +
' ' +
(state.signInfo.continuousDay >= item.day ? 'rewardTxt' : '')
"
@ -66,7 +65,7 @@
<!-- 签到说明 TODO @科举这里改成已累计签到 -->
<view class="bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40">
<view class="activity-title ss-m-b-30">签到说明</view>
<view class="activity-des">1每天签到可获得积分或经验</view>
<view class="activity-des">1已累计签到{{state.signInfo.totalDay}}</view>
<view class="activity-des">
2据说连续签到第 {{ state.maxDay }} 天可获得超额积分一定要坚持签到哦~~~
</view>
@ -111,7 +110,7 @@
signInfo: {}, //
signConfigList: [], //
maxDay: 0, //
maxDay: 0, //
showModel: false, //
signResult: {}, //

View File

@ -30,7 +30,8 @@
import {
reactive,
onBeforeMount,
nextTick
nextTick,
ref
} from 'vue';
import sheep from '@/sheep';
@ -52,7 +53,7 @@
const state = reactive({
currentValue: '0',
});
const typeList = [{
const typeList = reactive([{
// icon: '/static/img/shop/pay/wechat.png',
title: '工商银行',
value: '0',
@ -67,7 +68,7 @@
title: '农业',
value: '2',
},
];
])
const getWalletAccountInfo = async () => {
return new Promise(async (resolve, reject) => {
let res = await sheep.$api.user.account.info({

View File

@ -21,29 +21,44 @@
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.amount" type="number"
placeholder="请输入提现金额" />
</view>
<view class="card-title">持卡人</view>
<view class="input-box ss-flex ss-col-center border-bottom">
<view class="card-title" v-show='txfag==1'>持卡人</view>
<view class="input-box ss-flex ss-col-center border-bottom" v-show='txfag==1'>
<view class="unit"></view>
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.name"
placeholder="请输入持卡人姓名" />
</view>
<view class="card-title">卡号</view>
<view class="input-box ss-flex ss-col-center border-bottom">
<view class="card-title" v-show='txfag==1'>卡号</view>
<view class="input-box ss-flex ss-col-center border-bottom" v-show='txfag==1'>
<view class="unit"></view>
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.accountNo"
placeholder="请输卡号" />
</view>
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30">
<view class="card-title">收款码</view>
<view class="input-box ss-flex ss-col-center border-bottom">
<view class="unit"></view>
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.accountQrCodeUrl"
placeholder="请输收款码地址" />
</view>
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" style='display:block'>
<view class="name">选择提现方式</view>
<!-- <view class="bank-list ss-flex ss-col-center" style="margin-left:auto" >
<view class="empty-text">请选择提现方式</view>
<text class="cicon-forward"></text>
</view> -->
<uni-section title="单选" type="line">
<view class="uni-px-5 uni-pb-5" style='font-size:28rpx'>
<uni-data-checkbox v-model="txfag" :localdata="txList"></uni-data-checkbox>
</view>
</uni-section>
</view>
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" v-show='txfag==1'>
<view class="name">选择银行</view>
<view class="bank-list ss-flex ss-col-center" @tap="onAccountSelect(true)">
<view v-if="!state.accountInfo.type" class="empty-text"></view>
<view v-if="state.accountInfo.type === '0'" class="empty-text"></view>
<view v-if="state.accountInfo.type === '1'" class="empty-text"></view>
<view v-if="state.accountInfo.type === '2'" class="empty-text"></view>
<!-- <view v-if="!state.accountInfo.type" class="empty-text"></view>
<view v-if="state.accountInfo.type === 'wechat'" class="empty-text"></view>
<view v-if="state.accountInfo.type === 'alipay'" class="empty-text"></view>
<view v-if="state.accountInfo.type === 'bank'" class="empty-text"></view> -->
<text class="cicon-forward"></text>
</view>
</view>
@ -51,10 +66,6 @@
<view class="placeholder-text" v-if="state.accountInfo.account_name">
{{ state.accountInfo.account_header }}|{{ state.accountInfo.account_name }}
</view>
<!-- <view class="placeholder-text" v-else></view>
<button class="add-btn ss-reset-button" @tap="onAccountEdit(true)">
{{ state.accountInfo.account_name ? '修改' : '添加' }}
</button> -->
</view>
<button class="ss-reset-button save-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
确认提现
@ -91,7 +102,7 @@
import {
computed,
reactive,
onBeforeMount
onBeforeMount,ref
} from 'vue';
import sheep from '@/sheep';
import accountTypeSelect from './components/account-type-select.vue';
@ -130,7 +141,11 @@
return list;
}
let txfag=ref(1)
const txList=[{text:'银行卡提现',value:1},{text:'微信提现',value:2},{text:'支付宝提现',value:3}]
function tixian(v){
console.log(v)
}
const userStore = sheep.$store('user');
const userInfo = computed(() => userStore.userInfo);
const state = reactive({
@ -152,6 +167,7 @@
methods: [],
},
rulesList: [],
accountQrCodeUrl:''
});
const onAccountEdit = (e) => {
@ -167,8 +183,9 @@
accountNo: state.accountNo,
name: state.name,
bankName: state.accountInfo.type,
type: '2',
price: state.amount * 100
type: txfag.value,
price: state.amount * 100,
accountQrCodeUrl:state.accountQrCodeUrl
};
console.log(payload);
// return;

View File

@ -1,3 +1,7 @@
## 1.0.32022-09-16
- 可以使用 uni-scss 控制主题色
## 1.0.22022-06-30
- 优化 在 uni-forms 中的依赖注入方式
## 1.0.12022-02-07
- 修复 multiple 为 true 时v-model 的值为 null 报错的 bug
## 1.0.02021-11-19

View File

@ -155,17 +155,17 @@
value(newVal) {
this.dataList = this.getDataList(newVal)
// fix by mehaotian is_reset uni-forms
if(!this.is_reset){
this.is_reset = false
this.formItem && this.formItem.setValue(newVal)
}
// if(!this.is_reset){
// this.is_reset = false
// this.formItem && this.formItem.setValue(newVal)
// }
},
modelValue(newVal) {
this.dataList = this.getDataList(newVal);
if(!this.is_reset){
this.is_reset = false
this.formItem && this.formItem.setValue(newVal)
}
// if(!this.is_reset){
// this.is_reset = false
// this.formItem && this.formItem.setValue(newVal)
// }
}
},
data() {
@ -193,22 +193,22 @@
}
},
created() {
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
// this.form = this.getForm('uniForms')
// this.formItem = this.getForm('uniFormsItem')
// this.formItem && this.formItem.setValue(this.value)
if (this.formItem) {
this.isTop = 6
if (this.formItem.name) {
// name,formData
if(!this.is_reset){
this.is_reset = false
this.formItem.setValue(this.dataValue)
}
this.rename = this.formItem.name
this.form.inputChildrens.push(this)
}
}
// if (this.formItem) {
// this.isTop = 6
// if (this.formItem.name) {
// // name,formData
// if(!this.is_reset){
// this.is_reset = false
// this.formItem.setValue(this.dataValue)
// }
// this.rename = this.formItem.name
// this.form.inputChildrens.push(this)
// }
// }
if (this.localdata && this.localdata.length !== 0) {
this.isLocal = true
@ -273,7 +273,7 @@
}
}
}
this.formItem && this.formItem.setValue(detail.value)
// this.formItem && this.formItem.setValue(detail.value)
// TODO vue2
this.$emit('input', detail.value);
// // TOTO vue3
@ -375,7 +375,7 @@
selectedArr.push(item[this.map.value])
}
})
return this.dataValue && this.dataValue.length > 0 ? this.dataValue : selectedArr
return this.dataValue.length > 0 ? this.dataValue : selectedArr
},
/**
@ -384,11 +384,13 @@
setStyleBackgroud(item) {
let styles = {}
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
if (this.mode !== 'list') {
styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
}
if (this.mode === 'tag') {
styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
if (this.selectedColor) {
if (this.mode !== 'list') {
styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
}
if (this.mode === 'tag') {
styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
}
}
let classles = ''
for (let i in styles) {
@ -399,15 +401,16 @@
setStyleIcon(item) {
let styles = {}
let classles = ''
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
styles['background-color'] = item.selected?selectedColor:'#fff'
styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
if(!item.selected && item.disabled){
styles['background-color'] = '#F2F6FC'
if (this.selectedColor) {
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
styles['background-color'] = item.selected?selectedColor:'#fff'
styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
if(!item.selected && item.disabled){
styles['background-color'] = '#F2F6FC'
styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
}
}
for (let i in styles) {
classles += `${i}:${styles[i]};`
}
@ -416,16 +419,17 @@
setStyleIconText(item) {
let styles = {}
let classles = ''
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
if (this.mode === 'tag') {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666'
} else {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666'
if (this.selectedColor) {
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
if (this.mode === 'tag') {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666'
} else {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666'
}
if(!item.selected && item.disabled){
styles.color = '#999'
}
}
if(!item.selected && item.disabled){
styles.color = '#999'
}
for (let i in styles) {
classles += `${i}:${styles[i]};`
}
@ -448,7 +452,7 @@
</script>
<style lang="scss">
$checked-color: #2979ff;
$uni-primary: #2979ff !default;
$border-color: #DCDFE6;
$disable:0.4;
@ -614,8 +618,8 @@
//
&.is-checked {
.checkbox__inner {
border-color: $checked-color;
background-color: $checked-color;
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
@ -623,14 +627,14 @@
}
}
.radio__inner {
border-color: $checked-color;
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $checked-color;
background-color: $uni-primary;
}
}
.checklist-text {
color: $checked-color;
color: $uni-primary;
}
//
&.is-disable {
@ -683,10 +687,10 @@
}
&.is-checked {
border-color: $checked-color;
border-color: $uni-primary;
.checkbox__inner {
border-color: $checked-color;
background-color: $checked-color;
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
@ -694,16 +698,16 @@
}
.radio__inner {
border-color: $checked-color;
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $checked-color;
background-color: $uni-primary;
}
}
.checklist-text {
color: $checked-color;
color: $uni-primary;
}
//
@ -735,8 +739,8 @@
}
&.is-checked {
background-color: $checked-color;
border-color: $checked-color;
background-color: $uni-primary;
border-color: $uni-primary;
.checklist-text {
color: #fff;
@ -775,8 +779,8 @@
&.is-checked {
.checkbox__inner {
border-color: $checked-color;
background-color: $checked-color;
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
@ -789,13 +793,13 @@
}
}
.checklist-text {
color: $checked-color;
color: $uni-primary;
}
.checklist-content {
.checkobx__list {
opacity: 1;
border-color: $checked-color;
border-color: $uni-primary;
}
}

View File

@ -1,7 +1,7 @@
{
"id": "uni-data-checkbox",
"displayName": "uni-data-checkbox 数据选择器",
"version": "1.0.1",
"version": "1.0.3",
"description": "通过数据驱动的单选框和复选框",
"keywords": [
"uni-ui",
@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-load-more","uni-scss"],