落日晚风 1 年之前
父节点
当前提交
3c2f3ee716

+ 13 - 23
pages/activity/bargain/detail.vue

@@ -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')) {

+ 3 - 4
pages/app/sign.vue

@@ -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: {}, // 签到结果

+ 4 - 3
pages/pay/components/account-type-select.vue

@@ -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({

+ 34 - 17
pages/pay/withdraw.vue

@@ -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;

+ 4 - 0
uni_modules/uni-data-checkbox/changelog.md

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

+ 67 - 63
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@@ -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(!item.selected && item.disabled){
-					styles.color = '#999'
+				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'
+					}
 				}
-
 				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;
 							}
 						}
 

+ 4 - 7
uni_modules/uni-data-checkbox/package.json

@@ -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"],