zhengjinyi hace 3 años
padre
commit
f518f7e4ea

+ 38 - 5
App.vue

@@ -3,9 +3,9 @@
 	 * vuex管理登陆状态,具体可以参考官方登陆模板示例
 	 */
 	import Vue from 'vue'
-	import { mapState,mapMutations} from 'vuex';
+	import { mapState,mapMutations} from 'vuex'
 	import authorize from '@/common/config/authorize.js'
-	import wxLogin from "@/services/wxLogin.js"
+	import wxLogin from '@/services/wxLogin.js'
 	export default {
 		onLaunch: function() {
 			let self = this
@@ -57,17 +57,50 @@
 					// #endif
 				}
 			})
-			// this.refresh()
+			this.refresh()
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 		},
 		methods:{
+			...mapMutations(['login','logout','isWxAuthorize']),
+			async getWxAuthorize(){
+				const wechatCode = await authorize.getCode('weixin')// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
+				const getUserInfo = await authorize.getUserInfo('weixin')
+				this.UserService.UserLoginAuthApplets({ 
+					code:wechatCode,
+					encryptedData:getUserInfo.encryptedData,
+					iv:getUserInfo.iv
+				})
+				.then(response =>{
+					this.$store.commit('updateStatus',response.data)
+					this.login(response.data)
+					uni.setStorageSync('openid',response.data.openid)
+				})
+				.catch(error =>{
+					this.logout(error.data)
+					uni.setStorageSync('openid',error.data.openid)
+					this.$store.commit('updateStatus',error.data)
+					if(!this.hasLogin){
+						if(uni.getStorageSync('isActivitySwitch')){
+							const  lockTime = uni.getStorageSync('lockTime')
+							const  eTime = this.diffTime(lockTime)
+							this.$store.dispatch('setActivityFn',eTime)
+						}else{
+							this.$store.dispatch('setActivityFn',true)
+						}
+					}
+				})
+			},		
 			refresh(){
-				let TIME = (20*60)*1000;
+				let TIME = (20*60)*1000
 				setInterval(()=>{
-					wxLogin.wxLoginAuthorize()
+					this.getWxAuthorize()
 				},TIME)
+			},
+			diffTime(t){
+				let date = Date.now()
+				return (date -t) < 2*60*1000 ? false : true
 			}
 		},
 		onShow: function() {

+ 0 - 1
pages.json

@@ -11,7 +11,6 @@
 			"path": "pages/collection/sms",
 			"style": {
 				"navigationBarTitleText": "款项识别",
-				"enablePullDownRefresh":true,
 				"navigationStyle":"custom"
 			}
 		},

+ 18 - 179
pages/collection/detail.vue

@@ -52,19 +52,9 @@
 				<button class="button" open-type="share" :data-payment="payment">分享</button>
 			</view> 
 		</view>
-		<!-- 时间组件 -->
-		<tui-datetime ref="dateTime" :type="7" :startYear="startYear" :endYear="endYear" cancelColor="#555555"
-			color="#4688fa" @confirm="bindStartDateChange"></tui-datetime>
-		<!-- 弹窗提示 -->
-		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :title="contentModalTitle"
-			:content="contentModalText" :button="modalButton" color="#333" :size="32" shape="circle"
-			:maskClosable="false">
-		</tui-modal>
 	</view>
 </template>
 <script>
-	import statistic_bg2 from '@/static/temp/statistic_bg2.png'
-	import statistic_bg1 from '@/static/temp/statistic_bg1.png'
 	import wxLogin from '@/services/wxLogin.js'
 	import {
 		mapState,
@@ -74,19 +64,8 @@
 	export default {
 		data() {
 			return {
-				payment:{
-					id: 6090,
-					receiptAmount: 500000, //收款金额
-					associateAmount: 5000, //关联金额
-					payType: '广发银行-0115', //收款类型
-					receiptDate: '2022-02-15 10:58:25', // 收款时间
-					reviewDate: '2022-02-15 10:58:25', // 审核时间
-					smsContent: '【中信银行】您尾号0897的中信卡于05月29日14:42,二代支付存入人民币99.00元,当前余额为人民币13871.67元。',
-					confirmType: 0,
-					userName: '采美网络信息有限公司',
-					sourceType: 2,
-					state: 1
-				},
+				payment:{},
+				payDetailsId:0,
 				nvabarData: {
 					//顶部自定义导航
 					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
@@ -98,10 +77,6 @@
 					bgColor: '#D33020',
 					textColor: '#ffffff'
 				},
-				type: 7,
-				setDateTime: '',
-				startYear: 1980,
-				endYear: 2030,
 				modalButton: [{
 						text: '取消',
 						type: 'gray',
@@ -116,82 +91,15 @@
 						plain: false
 					}
 				],
-				paymentActions: [{
-						name: '普通款项',
-						value: 1
-					},
-					{
-						name: '返佣款项',
-						value: 2
-					},
-					{
-						name: '供应商退款',
-						value: 3
-					}
-				],
-				banksActions: [{
-						name: '建设银行-7297',
-						value: 1
-					},
-					{
-						name: '广发银行-0115',
-						value: 2
-					},
-					{
-						name: '中信银行-7172',
-						value: 3
-					},
-					{
-						name: '中信银行-0897',
-						value: 4
-					},
-					{
-						name: '中信银行0897-财付通',
-						value: 5
-					},
-					{
-						name: '中信银行0897-支付宝',
-						value: 6
-					},
-					{
-						name: '支付宝',
-						value: 7
-					},
-					{
-						name: '微信支付',
-						value: 8
-					},
-					{
-						name: '快钱支付',
-						value: 9
-					}
-				],
-				paymentTypeText: '普通款项', // 款项类型显示文案
-				banksTypeText: '建设银行-7297', // 款项类型显示文案
-				params: {
-					type: 1,
-					banksType: 1,
-					amount: '',
-					chargeValue: '',
-					remarks: '',
-					time: this.$api.getNowFormatDate()
-				},
-				infoData: {},
 				isCmcustomClass: 'left',
-				statistic_bg: statistic_bg2,
-				statistic_bg1: statistic_bg1,
 				CustomBar: this.CustomBar, // 顶部导航栏高度
 				height: 64, //header高度
 				top: 0, //标题图标距离顶部距离
 				scrollH: 0, //滚动总高度
 				opcity: 1,
-				isCheckedCharge: false,
-				contentModalTitle: '',
-				contentModalText: '', //操作文字提示语句
-				modal: false,
 			}
 		},
-		onLoad() {
+		onLoad(option) {
 			let obj = {}
 			// #ifdef MP-WEIXIN
 			obj = wx.getMenuButtonBoundingClientRect()
@@ -210,6 +118,8 @@
 					this.scrollH = res.windowWidth * 0.6
 				}
 			})
+			this.payDetailsId = option.id
+			this.getOrderReceiptDetail(option.id)
 		},
 		filters: {
 			NumFormat: function(text) {
@@ -218,87 +128,18 @@
 			}
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo'])
+			...mapState(['hasLogin', 'openid'])
 		},
 		methods: {
-			bindPickerChange(type, e) {
-				// 选择选项
-				switch (type) {
-					case 1:
-						this.paymentTypeText = this.paymentActions[e.target.value].name
-						this.params.type = this.paymentActions[e.target.value].value
-						console.log('款项类型', this.paymentTypeText)
-						console.log('款项类型', this.params.type)
-						break
-					case 2:
-						this.banksTypeText = this.paymentActions[e.target.value].name
-						this.params.banksType = this.paymentActions[e.target.value].value
-						console.log('收款类型', this.params.banksType)
-						break
-				}
-			},
-			showTuiDateTime() {
-				this.$refs.dateTime.show()
-			},
-			bindStartDateChange(event) {
-				//开始时间
-				console.log('开始时间==>', event.result)
-				this.params.time = event.result
-			},
-			confirmDistinguish() {
-				if (this.params.amount == '') {
-					this.$util.msg('请输入收款金额', 2000)
-					return
-				}
-				if (this.isCheckedCharge) {
-					if (this.params.chargeValue == '') {
-						this.$util.msg('请输入手续费', 2000)
-						return
-					}
-				}
-				if (this.params.remarks == '') {
-					this.$util.msg('请填写收款备注', 2000)
-					return
-				}
-				if (this.params.type == 1) {
-					this.contentModalTitle = '确定收款吗?'
-					this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
-				} else if (this.params.type == 2) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
-				} else if (this.params.type == 3) {
-					this.contentModalTitle = ''
-					this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
-				}
-				this.modal = true
-				console.log('收款')
-			},
-			handleClick(e) {
-				// 确认收款
-				if (e.index == 1) {
-
-				}
-				this.modal = false
-			},
-			hideMobel() {
-				this.modal = false
-			},
-			checkedCharge() {
-				// 勾选手续费
-				this.isCheckedCharge = !this.isCheckedCharge
-			},
-			changeNumber(e) {
-				// 校验输入为数字
-				if (!this.$api.isNumber(e.detail.value)) {
-					this.params.amount = ''
-				} else {
-					this.params.amount = e.detail.value
-				}
-			},
-			navBack() {
-				uni.navigateBack({
-					delta: 1
-				})
+			getOrderReceiptDetail(id){
+				// 收款详情
+				this.OrderService.orderReceiptDetail({ id : id , openid :'oL3JP4-dOMlrax1aRMC-SDSlUdNE' })
+					.then(response => {
+						console.log('response',response)
+					})
+					.catch(err => {
+						this.$util.msg(err.msg, 2000)
+					})
 			}
 		},
 		onPageScroll(e) {
@@ -311,7 +152,7 @@
 		},
 		onPullDownRefresh() {
 			setTimeout(() => {
-				// this.initSsoMemberCollectionList()
+				this.getOrderReceiptDetail(this.payDetailsId)
 				uni.stopPullDownRefresh()
 			}, 200)
 		},
@@ -373,7 +214,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -384,13 +224,12 @@
 		}
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 	}
 

+ 2 - 4
pages/collection/list.vue

@@ -948,7 +948,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -960,13 +959,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 2 - 4
pages/collection/nosms.vue

@@ -375,7 +375,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 		.header-sit-text {
 			text-align: left;
@@ -385,13 +384,12 @@
 		}
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 	}	
 

+ 560 - 444
pages/collection/sms.vue

@@ -1,28 +1,41 @@
 <template>
 	<view class="container mine clearfix">
 		<!-- <cu-custom :navbar-data='nvabarData'  @navigateBack="hanldNavigateBack"></cu-custom> -->
-		<view class="tui-header-box first"
-			:style="{height:isCmcustomClass == 'fiexd'? CustomBar+10+'px' : CustomBar+30+'px'}"
-			:class="isCmcustomClass">
-			<view class="header-top" :style="{paddingTop:top+'px',lineHeight: CustomBar+30+'px'}"></view>
+		<view
+			class="tui-header-box first"
+			:style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
+			:class="isCmcustomClass"
+		>
+			<view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
 			<view class="header-sit">
 				<text class="iconfont icon-fanhui" @click.stop="checkedSms" v-if="receiptType == 2"></text>
 				<text class="header-sit-text">{{ receiptType == 1 ? '款项识别' : '无短信收款' }}</text>
 			</view>
 		</view>
-		<view class="tui-header-box" :style="{height:CustomBar+30+'px',backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)'}">
+		<view
+			class="tui-header-box"
+			:style="{
+				height: CustomBar + 30 + 'px',
+				backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)'
+			}"
+		>
 		</view>
-		<view class="distinguish-section" :style="{top:CustomBar+'px',left:0+'px'}">
+		<view class="distinguish-section" :style="{ top: CustomBar + 'px', left: 0 + 'px' }">
 			<view class="distinguish-section-conten">
 				<view class="section-top">
 					<view class="title" v-if="receiptType == 1">收款短信</view>
 					<view class="button" @click="toNoSms('/pages/collection/list')">
-						<text class="iconfont icon-wodedingdan"></text>
-						收款列表
+						<text class="iconfont icon-wodedingdan"></text> 收款列表
 					</view>
 				</view>
 				<view class="section-textarea" v-if="receiptType == 1">
-					<textarea class="textarea" placeholder="收款短信内容..." :disabled="modal" v-model="params.smsContent" @blur="onTextareaInput" />
+					<textarea
+						class="textarea"
+						placeholder="收款短信内容..."
+						:disabled="modal"
+						v-model="params.smsContent"
+						@blur="onBlurSmsContent"
+					/>
 				</view>
 				<template v-if="isConfirm">
 					<view class="section-rows">
@@ -52,7 +65,7 @@
 							<input
 								class="input"
 								type="text"
-								v-model="params.time"
+								v-model="params.receiptDate"
 								disabled="true"
 								placeholder="请选择收款时间"
 								@click="showTuiDateTime"
@@ -60,13 +73,14 @@
 						</view>
 						<text class="iconfont icon-xiayibu"></text>
 					</view>
-					<view class="section-rows">
+					<view class="section-rows" :class="isReceiptType ? 'disabled' : ''">
 						<view class="rows-label">收款类型:</view>
 						<view class="rows-mains">
 							<picker
 								@change="bindPickerChange(2, $event)"
 								:value="index"
-								:range="banksActions"
+								:range="receiptTypeActions"
+								:disabled="isReceiptType"
 								range-key="name"
 							>
 								<input
@@ -93,19 +107,15 @@
 						</view>
 					</view>
 					<view class="section-rows" :class="isCheckedCharge ? '' : 'disabled'">
-						<view class="rows-label">
-							<text
-								class="iconfont"
-								:class="isCheckedCharge ? 'icon-yixuanze' : 'icon-weixuanze'"
-								@click="checkedCharge"
-							></text>
+						<view class="rows-label" @click="checkedCharge">
+							<text class="iconfont" :class="isCheckedCharge ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
 							手续费:
 						</view>
 						<view class="rows-mains">
 							<input
 								class="input"
-								v-model="params.chargeValue"
-								@blur="chargeValueNumber($event)"
+								v-model="params.handlingFee"
+								@blur="handlingFeeNumber($event)"
 								:disabled="!isCheckedCharge"
 								type="text"
 								placeholder="请输入手续费"
@@ -115,13 +125,27 @@
 					<template v-if="receiptType == 2">
 						<view class="section-text">收款短信(备注,必填)</view>
 						<view class="section-textarea">
-							<textarea class="textarea" :disabled="modal" placeholder="请输入收款备注..." v-model="params.remarks" />
+							<textarea
+								class="textarea"
+								:disabled="modal"
+								placeholder="请输入收款备注..."
+								v-model="params.smsContent"
+							/>
 						</view>
 					</template>
 				</template>
 			</view>
 			<view class="distinguish-button">
-				<tui-button type="primary" :disabledGray="true" :disabled="disabled" :height="'80rpx'" :shadow="true" shape="circle" @click="confirmDistinguish">收款</tui-button>
+				<tui-button
+					type="primary"
+					:disabledGray="true"
+					:disabled="disabled"
+					:height="'80rpx'"
+					:shadow="true"
+					shape="circle"
+					@click="confirmDistinguish"
+					>收款</tui-button
+				>
 			</view>
 			<view class="distinguish-button-text" @click="checkedNoSms" v-if="receiptType == 1">无短信收款</view>
 		</view>
@@ -152,490 +176,582 @@
 	</view>
 </template>
 <script>
-	import statistic_bg2 from '@/static/temp/statistic_bg2.png'
-	import statistic_bg1 from '@/static/temp/statistic_bg1.png'
-	import wxLogin from '@/services/wxLogin.js'
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex'
-
-	export default {
-		data() {
-			return {
-				nvabarData: { //顶部自定义导航
-					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
-					showSearch: 0,
-					title: '', // 导航栏 中间的标题
-					haveBack: false,
-					home: false,
-					textLeft: this.$store.state.isIphone,
-					bgColor: '#D33020',
-					textColor: '#ffffff'
+import statistic_bg2 from '@/static/temp/statistic_bg2.png'
+import statistic_bg1 from '@/static/temp/statistic_bg1.png'
+import wxLogin from '@/services/wxLogin.js'
+import { mapState, mapMutations } from 'vuex'
+const defaultParams = {
+	smsContent: '', // 收款短信
+	payType: null,
+	receiptType: 1, // 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
+	openid: null, // 微信openid
+	receiptAmount: '', //收款金额
+	handlingFee: '', //手续费
+	receiptDate: null // 收款时间
+}
+export default {
+	data() {
+		return {
+			nvabarData: {
+				//顶部自定义导航
+				showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
+				showSearch: 0,
+				title: '', // 导航栏 中间的标题
+				haveBack: false,
+				home: false,
+				textLeft: this.$store.state.isIphone,
+				bgColor: '#D33020',
+				textColor: '#ffffff'
+			},
+			receiptType: 1, //收款方式 1 短信收款 2 无短信收款
+			infoData: {},
+			isCmcustomClass: 'left',
+			statistic_bg: statistic_bg2,
+			statistic_bg1: statistic_bg1,
+			CustomBar: this.CustomBar, // 顶部导航栏高度
+			height: 64, //header高度
+			top: 0, //标题图标距离顶部距离
+			scrollH: 0, //滚动总高度
+			opcity: 1,
+			isConfirm: false,
+			type: 7,
+			setDateTime: '',
+			startYear: 1980,
+			endYear: 2030,
+			modalButton: [
+				{
+					text: '取消',
+					type: 'gray',
+					plain: true //是否空心
 				},
-				receiptType:1, //收款方式 1 短信收款 2 无短信收款
-				infoData: {},
-				isCmcustomClass: 'left',
-				statistic_bg: statistic_bg2,
-				statistic_bg1: statistic_bg1,
-				CustomBar: this.CustomBar, // 顶部导航栏高度
-				height: 64, //header高度
-				top: 0, //标题图标距离顶部距离
-				scrollH: 0, //滚动总高度
-				opcity: 1,
-				isConfirm: false,
-				type: 7,
-				setDateTime: '',
-				startYear: 1980,
-				endYear: 2030,
-				modalButton: [
-					{
-						text: '取消',
-						type: 'gray',
-						plain: true //是否空心
+				{
+					text: '确认',
+					customStyle: {
+						color: '#fff',
+						bgColor: '#4688fa'
 					},
-					{
-						text: '确认',
-						customStyle: {
-							color: '#fff',
-							bgColor: '#4688fa'
-						},
-						plain: false
-					}
-				],
-				paymentActions: [
-					{ name: '普通款项', value: 1 },
-					{ name: '返佣款项', value: 2 },
-					{ name: '供应商退款', value: 3 }
-				],
-				banksActions: [
-					{ name: '建设银行-7297', value: 1 },
-					{ name: '广发银行-0115', value: 2 },
-					{ name: '中信银行-7172', value: 3 },
-					{ name: '中信银行-0897', value: 4 },
-					{ name: '中信银行0897-财付通', value: 5 },
-					{ name: '中信银行0897-支付宝', value: 6 },
-					{ name: '支付宝', value: 7 },
-					{ name: '微信支付', value: 8 },
-					{ name: '快钱支付', value: 9 }
-				],
-				paymentTypeText: '普通款项', // 款项类型显示文案
-				banksTypeText: '建设银行-7297', // 款项类型显示文案
-				params: {
-					smsContent:'',
-					type: 1,
-					banksType: 1,
-					receiptAmount: '',
-					chargeValue: '',
-					remarks: '',
-					time: this.$api.getNowFormatDate()
-				},
-				isCheckedCharge: false,
-				contentModalTitle:'',
-				contentModalText: '', //操作文字提示语句
-				modal: false,
+					plain: false
+				}
+			],
+			paymentActions: [
+				{ name: '普通款项', value: 1 },
+				{ name: '返佣款项', value: 3 },
+				{ name: '供应商退款', value: 5 }
+			],
+			receiptTypeActions: [],
+			paymentTypeText: '普通款项', // 款项类型显示文案
+			banksTypeText: '', // 款项类型显示文案
+			params: {
+				smsContent:
+					'【中信银行】您尾号0897的中信卡于05月29日14:42,二代支付存入人民币99.00元,当前余额为人民币13871.67元。', // 收款短信
+				payType: null, //付款类型
+				receiptType: 1, // 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
+				openid: null, // 微信openid
+				receiptAmount: '', //收款金额
+				handlingFee: '', //手续费
+				receiptDate: null // 收款时间
+			},
+			handleCharge: 0,
+			isCheckedCharge: false,
+			isReceiptType: false,
+			contentModalTitle: '',
+			contentModalText: '', //操作文字提示语句
+			modal: false
+		}
+	},
+	onLoad() {
+		let obj = {}
+		// #ifdef MP-WEIXIN
+		obj = wx.getMenuButtonBoundingClientRect()
+		// #endif
+		// #ifdef MP-BAIDU
+		obj = swan.getMenuButtonBoundingClientRect()
+		// #endif
+		// #ifdef MP-ALIPAY
+		my.hideAddToDesktopMenu()
+		// #endif
+		uni.getSystemInfo({
+			success: res => {
+				this.width = obj.left || res.windowWidth
+				this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
+				this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
+				this.scrollH = res.windowWidth * 0.6
 			}
-		},
-		onLoad() {
-			let obj = {}
-			// #ifdef MP-WEIXIN
-			obj = wx.getMenuButtonBoundingClientRect()
-			// #endif
-			// #ifdef MP-BAIDU
-			obj = swan.getMenuButtonBoundingClientRect()
-			// #endif
-			// #ifdef MP-ALIPAY
-			my.hideAddToDesktopMenu()
-			// #endif
-			uni.getSystemInfo({
-				success: (res) => {
-					this.width = obj.left || res.windowWidth
-					this.height = obj.top ? (obj.top + obj.height + 8) : (res.statusBarHeight + 44)
-					this.top = obj.top ? (obj.top + (obj.height - 32) / 2) : (res.statusBarHeight + 6)
-					this.scrollH = res.windowWidth * 0.6
+		})
+		this.getOrderReceiptType()
+	},
+	filters: {
+		NumFormat: function(text) {
+			//处理金额
+			return Number(text).toFixed(2)
+		}
+	},
+	computed: {
+		...mapState(['openid']),
+		disabled: function() {
+			let bool = true
+			if (this.receiptType == 1) {
+				if (this.params.smsContent || this.params.receiptAmount) {
+					bool = false
 				}
-			})
-
+			} else {
+				if (this.params.receiptAmount) {
+					bool = false
+				}
+			}
+			return bool
+		}
+	},
+	methods: {
+		getOrderReceiptSave() {
+			// 收款保存
+			this.OrderService.orderReceiptSave(this.params)
+				.then(response => {
+					this.$util.msg('收款成功', 1500, true, 'success')
+					setTimeout(() => {
+						this.$api.navigateTo(`/pages/collection/detail?id=${response.data.id}`)
+					}, 1500)
+				})
+				.catch(err => {
+					this.$util.msg(err.msg, 2000)
+				})
 		},
-		filters: {
-			NumFormat: function(text) { //处理金额
-				return Number(text).toFixed(2)
-			},
+		getOrderReceiptType() {
+			// 获取收款类型列表
+			this.OrderService.orderReceiptType()
+				.then(response => {
+					this.receiptTypeActions = response.data.map(item => ({
+						...item,
+						name: item.type,
+						value: item.id
+					}))
+				})
+				.catch(err => {
+					this.$util.msg(err.msg, 2000)
+				})
 		},
-		computed: {
-			disabled: function() {
-				let bool = true
-				if(this.receiptType == 1){
-					if ( this.params.smsContent || this.params.receiptAmount ) {
-						bool = false
-					}
-				}else{
-					if ( this.params.receiptAmount ) {
-						bool = false
+		orderReceiptReadSms() {
+			// 识别收款短信
+			this.params.openid = this.openid
+			this.OrderService.orderReceiptReadSms(this.params)
+				.then(response => {
+					const data = response.data
+					this.params.payType = data.payType
+					this.params.receiptAmount = data.receiptAmount
+					this.params.receiptDate = data.receiptDate
+					this.handleCharge = this.params.handlingFee = data.handlingFee
+					this.receiptTypeActions.forEach(el => {
+						if (this.params.payType === el.value) {
+							this.banksTypeText = el.name
+						}
+					})
+					if (this.params.handlingFee > 0) {
+						this.isCheckedCharge = true
 					}
-				}
-				return bool
-			}
+					// 处理收款类型禁止点击
+					this.isReceiptType = true
+					console.log('isReceiptType', this.isReceiptType)
+					this.initInput()
+				})
+				.catch(err => {
+					this.$util.msg(err.msg, 2000)
+				})
 		},
-		methods: {
-			bindPickerChange(type, e) {
-				// 选择选项
-				switch (type) {
-					case 1:
-						this.paymentTypeText = this.paymentActions[e.target.value].name
-						this.params.type = this.paymentActions[e.target.value].value
-						console.log('款项类型', this.paymentTypeText)
-						console.log('款项类型', this.params.type)
-						break
-					case 2:
-						this.banksTypeText = this.banksActions[e.target.value].name
-						this.params.banksType = this.banksActions[e.target.value].value
-						console.log('收款类型', this.params.banksType)
-						break
-				}
-			},
-			showTuiDateTime() {
-				this.$refs.dateTime.show()
-			},
-			bindStartDateChange(event) {
-				//开始时间
-				console.log('开始时间==>', event.result)
-				this.params.time = event.result
-			},
-			confirmDistinguish() {
-				if (this.params.receiptAmount == '') {
-					this.$util.msg('请输入收款金额', 2000)
+		
+		confirmDistinguish() {
+			if (this.params.receiptAmount == '') {
+				this.$util.msg('请输入收款金额', 2000)
+				return
+			}
+			if (this.isCheckedCharge) {
+				if (this.params.handlingFee == '') {
+					this.$util.msg('请输入手续费', 2000)
 					return
 				}
-				if (this.isCheckedCharge) {
-					if (this.params.chargeValue == '') {
-						this.$util.msg('请输入手续费', 2000)
-						return
-					}
-				}
-				if (this.params.remarks == '') {
+			}
+			if (this.receiptType == 2) {
+				if (this.params.smsContent == '') {
 					this.$util.msg('请填写收款备注', 2000)
 					return
 				}
-				if(this.params.type == 1){
-					this.contentModalTitle ='确定收款吗?'
-					this.contentModalText ='确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
-				}else if(this.params.type == 2){
-					this.contentModalTitle =''
-					this.contentModalText ='确定返佣收款吗?' //操作文字提示语句
-				}else if(this.params.type == 3){
-					this.contentModalTitle =''
-					this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
-				}
-				this.modal = true
-				console.log('收款')
-			},
-			handleClick(e){
-				// 确认收款
-				if (e.index == 1) {
-					this.$api.navigateTo('/pages/collection/detail')
-				}
-				this.modal = false
-			},
-			hideMobel(){
-				this.modal = false
-			},
-			checkedCharge() {
-				// 勾选手续费
-				this.isCheckedCharge = !this.isCheckedCharge
-			},
-			changeNumber(e) {
-				// 校验输入为数字
-				this.params.receiptAmount = this.checkedNumberVal(e.detail.value)
-				console.log('receiptAmount',this.params.receiptAmount)
-			},
-			chargeValueNumber(e) {
-				// 校验输入为数字
-				this.params.chargeValue = this.checkedNumberVal(e.detail.value)
-				console.log('chargeValue',this.params.chargeValue)
-			},
-			checkedNoSms(){// 切换无短信收款
-				this.receiptType = 2
-				this.isConfirm = true
-			},
-			checkedSms(){// 切换款项识别
-				this.receiptType = 1
-				this.isConfirm = false
-			},
-			onTextareaInput(e){
-			   this.params.smsContent = e.detail.value
-			   if ( this.params.smsContent) {
-				    this.initInput()
-			   }
-			},
-			checkedNumberVal(val){// 校验是否输入的是数字
-				if (!this.$api.isNumber(val)) {
-					return ''
+			}
+			if (this.params.receiptType == 1) {
+				// 普通订单款
+				this.contentModalTitle = '确定收款吗?'
+				this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
+			} else if (this.params.receiptType == 3) {
+				// 返佣款
+				this.contentModalTitle = ''
+				this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
+			} else if (this.params.receiptType == 5) {
+				// 供应商退款
+				this.contentModalTitle = ''
+				this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
+			}
+			this.modal = true
+			console.log('收款')
+		},
+		
+		bindPickerChange(type, e) {
+			// 选择选项
+			switch (type) {
+				case 1:
+					this.paymentTypeText = this.paymentActions[e.target.value].name
+					this.params.receiptType = this.paymentActions[e.target.value].value
+					console.log('款项类型', this.params.receiptType)
+					break
+				case 2:
+					this.banksTypeText = this.receiptTypeActions[e.target.value].name
+					this.params.payType = this.receiptTypeActions[e.target.value].value
+					console.log('收款类型', this.params.payType)
+					break
+			}
+		},
+		checkedNoSms() {
+			// 切换无短信收款
+			this.receiptType = 2
+			this.isConfirm = true
+			this.isReceiptType = false
+			this.params = Object.assign(this.params, defaultParams)
+			this.params.receiptDate = this.$api.getNowFormatDate()
+			this.params.payType = this.receiptTypeActions[0].value
+			this.banksTypeText = this.receiptTypeActions[0].name
+			this.params.openid = this.openid
+		},
+		checkedSms() {
+			// 切换款项识别
+			this.receiptType = 1
+			this.isConfirm = false
+		},
+		onBlurSmsContent(e) {
+			this.params.smsContent = e.detail.value
+			if (this.params.smsContent) {
+				this.orderReceiptReadSms()
+			}
+		},
+		showTuiDateTime() {
+			this.$refs.dateTime.show()
+		},
+		bindStartDateChange(event) {
+			//开始时间
+			console.log('开始时间==>', event.result)
+			this.params.receiptDate = event.result
+		},
+		checkedCharge() {
+			// 勾选手续费
+			this.isCheckedCharge = !this.isCheckedCharge
+			if (this.receiptType == 1) {
+				// 短信收款处理勾选手续费
+				if (!this.isCheckedCharge) {
+					this.params.handlingFee = 0
+					this.params.receiptAmount = this.params.receiptAmount - this.handleCharge
 				} else {
-					return val
+					this.params.handlingFee = this.handleCharge
+					this.params.receiptAmount = this.params.receiptAmount + this.params.handlingFee
 				}
-			},
-			initInput() {
-				if ( this.params.smsContent != '' ) {
-					this.isConfirm = true
+			} else {
+				// 无短信收款处理勾选手续费计算
+				if (!this.isCheckedCharge) {
+					this.params.receiptAmount = this.params.receiptAmount - this.params.handlingFee
+					this.params.handlingFee = ''
 				} else {
-					this.isConfirm = false
+					this.params.receiptAmount = this.params.receiptAmount + this.params.handlingFee
 				}
-			},
-			toNoSms(url){
-				this.$api.navigateTo(url)
 			}
 		},
-		onPageScroll(e) { //实时获取到滚动的值
-			// if (e.scrollTop > 30) {
-			// 	this.isCmcustomClass = 'fiexd'
-			// } else {
-			// 	this.isCmcustomClass = 'left'
-			// }
+		handleClick(e) {
+			// 确认收款
+			// 确认收款
+			if (e.index == 1) {
+				this.getOrderReceiptSave()
+			}
+			this.modal = false
+		},
+		hideMobel() {
+			// 取消收款
+			this.modal = false
 		},
-		onPullDownRefresh() {
-			setTimeout(() => {
-				// this.initSsoMemberCollectionList()
-				uni.stopPullDownRefresh()
-			}, 200)
+		changeNumber(e) {
+			// 校验输入为数字
+			this.params.receiptAmount = this.checkedNumberVal(e.detail.value)
+			console.log('receiptAmount', this.params.receiptAmount)
 		},
-		onShow() {
-			if (this.hasLogin) {
-				this.GetDataInfo()
+		handlingFeeNumber(e) {
+			// 校验输入为数字
+			this.params.handlingFee = Number(this.checkedNumberVal(e.detail.value))
+			if (this.isCheckedCharge) {
+				this.params.receiptAmount = Number(this.params.receiptAmount) + this.params.handlingFee
 			}
+		},
+		checkedNumberVal(val) {
+			// 校验是否输入的是数字
+			if (!this.$api.isNumber(val)) {
+				return ''
+			} else {
+				return val
+			}
+		},
+		initInput() {
+			if (this.params.smsContent != '') {
+				this.isConfirm = true
+			} else {
+				this.isConfirm = false
+			}
+		},
+		toNoSms(url) {
+			this.$api.navigateTo(url)
+		}
+	},
+	onPageScroll(e) {
+		//实时获取到滚动的值
+		// if (e.scrollTop > 30) {
+		// 	this.isCmcustomClass = 'fiexd'
+		// } else {
+		// 	this.isCmcustomClass = 'left'
+		// }
+	},
+	onPullDownRefresh() {
+		setTimeout(() => {
+			// this.initSsoMemberCollectionList()
+			uni.stopPullDownRefresh()
+		}, 200)
+	},
+	onShow() {
+		if (this.hasLogin) {
+			this.GetDataInfo()
 		}
 	}
+}
 </script>
 
 <style lang="scss">
-	@import "@/uni.scss";
+@import '@/uni.scss';
 
-	page {
-		background: #FFF;
+page {
+	background: #fff;
+}
+
+.tui-header-box {
+	width: 100%;
+	background: #ffffff;
+	z-index: 999;
+	background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
+	background-size: cover;
+	&.fiexd {
+		position: fixed;
+		top: 0;
+		left: 0;
 	}
+}
+.header-top {
+	width: 100%;
+	font-size: 16px;
+	font-weight: 500;
+	height: 32px;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	position: relative;
+	padding: 0 40rpx;
+}
 
-	.tui-header-box {
-		width: 100%;
-		background: #FFFFFF;
-		z-index: 999;
-		background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
-		background-size: cover;
-		&.fiexd {
-			position: fixed;
-			top: 0;
-			left: 0;
-		}
+.header-sit {
+	width: 100%;
+	box-sizing: border-box;
+	height: 80rpx;
+	line-height: 80rpx;
+	box-sizing: border-box;
+	color: #ffffff;
+	padding: 0 24rpx;
+	.header-sit-text {
+		text-align: left;
+		font-size: $font-size-40;
+		font-weight: 600;
+		font-family: '正楷';
 	}
-	.header-top {
-		width: 100%;
-		font-size: 16px;
-		font-weight: 500;
-		height: 32px;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		position: relative;
-		padding: 0 40rpx;
+	.icon-fanhui {
+		display: block;
+		width: 56rpx;
+		height: 80rpx;
+		float: left;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: 42rpx;
 	}
+}
+
+.mine {
+	width: 100%;
+	height: 100%;
+	position: relative;
+}
 
-	.header-sit {
+.distinguish-section {
+	width: 100%;
+	position: absolute;
+	padding: 20rpx 20rpx;
+	box-sizing: border-box;
+}
+
+.distinguish-section-conten {
+	width: 100%;
+	height: auto;
+	position: relative;
+	background-color: #ffffff;
+	border-radius: 20rpx;
+	padding: 20rpx;
+	box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
+	.section-top {
 		width: 100%;
+		height: 86rpx;
 		box-sizing: border-box;
-		height: 80rpx;
-		line-height: 80rpx;
-		box-sizing: border-box;
-		padding: 0 24rpx;
-		color: #ffffff;
-		.header-sit-text {
-			text-align: left;
-			font-size: $font-size-40;
-			font-weight: 600;
-			font-family: '正楷';
-		}
-		.icon-fanhui {
-			display: block;
-			width: 38rpx;
-			height: 80rpx;
+		padding-bottom: 20rpx;
+		.title {
 			float: left;
-			text-align: left;
-			line-height: 80rpx;
-			font-size: 42rpx;
-			margin-right: 15rpx;
+			line-height: 66rpx;
+			font-size: $font-size-28;
+			color: #333333;
+			.iconfont {
+				color: #666666;
+				font-size: $font-size-44;
+			}
 		}
-	}
 
-	.mine {
-		width: 100%;
-		height: 100%;
-		position: relative;
+		.button {
+			float: right;
+			box-sizing: border-box;
+			padding: 0 24rpx;
+			height: 100%;
+			line-height: 66rpx;
+			background: $btn-confirm;
+			border-radius: 8rpx;
+			text-align: center;
+			color: #ffffff;
+		}
 	}
-
-	.distinguish-section {
+	.section-rows {
 		width: 100%;
-		position: absolute;
-		padding: 20rpx 20rpx;
+		height: 80rpx;
 		box-sizing: border-box;
-	}
-
-	.distinguish-section-conten {
-		width: 100%;
-		height: auto;
+		padding: 0 20rpx;
+		border-radius: 8rpx;
+		background: #f8f8f8;
+		margin-top: 20rpx;
+		line-height: 80rpx;
+		display: flex;
 		position: relative;
-		background-color: #FFFFFF;
-		border-radius: 20rpx;
-		padding: 20rpx;
-		box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
-		.section-top {
-			width: 100%;
-			height: 86rpx;
-			box-sizing: border-box;
-			padding-bottom: 20rpx;
-			.title {
-				float: left;
-				line-height: 66rpx;
-				font-size: $font-size-28;
-				color: #333333;
-				.iconfont {
-					color: #666666;
-					font-size: $font-size-44;
-				}
-			}
-
-			.button {
-				float: right;
-				box-sizing: border-box;
-				padding: 0 24rpx;
-				height: 100%;
-				line-height: 66rpx;
-				background: $btn-confirm;
-				border-radius: 8rpx;
-				text-align: center;
-				color: #FFFFFF;
-			}
+		&.disabled {
+			background: #e1e1e1;
 		}
-		.section-rows {
-			width: 100%;
-			height: 80rpx;
-			box-sizing: border-box;
-			padding: 0 20rpx;
-			border-radius: 8rpx;
-			background: #f8f8f8;
-			margin-top: 20rpx;
-			line-height: 80rpx;
-			display: flex;
-			position: relative;
-			&.disabled {
-				background: #e1e1e1;
-			}
-			.rows-label {
-				flex: 3;
-				.iconfont {
-					margin-right: 8rpx;
-					&.icon-yixuanze {
-						color: $color-system;
-					}
-				}
-			}
-			.rows-mains {
-				flex: 7;
-				.input {
-					width: 100%;
-					height: 80rpx;
-					box-sizing: border-box;
-					padding-right: 40rpx;
-					text-align: left;
-					font-size: $font-size-28;
-					color: #333333;
+		.rows-label {
+			flex: 3;
+			.iconfont {
+				margin-right: 8rpx;
+				&.icon-yixuanze {
+					color: $color-system;
 				}
 			}
-			.icon-xiayibu {
-				display: block;
-				width: 40rpx;
-				height: 80rpx;
-				position: absolute;
-				right: 0;
-				text-align: center;
-				font-size: $font-size-32;
-			}
-		}
-		.section-text {
-			width: 100%;
-			height: 66rpx;
-			line-height: 66rpx;
-			font-size: $font-size-24;
-			color: #333333;
 		}
-		.section-textarea {
-			width: 100%;
-			height: 200rpx;
-			box-sizing: border-box;
-			padding: 20rpx;
-			background: #F7F7F7;
-			border-radius: 8rpx;
-			.textarea {
+		.rows-mains {
+			flex: 7;
+			.input {
 				width: 100%;
-				height: 100%;
+				height: 80rpx;
+				box-sizing: border-box;
+				padding-right: 40rpx;
+				text-align: left;
+				font-size: $font-size-28;
+				color: #333333;
 			}
 		}
+		.icon-xiayibu {
+			display: block;
+			width: 40rpx;
+			height: 80rpx;
+			position: absolute;
+			right: 0;
+			text-align: center;
+			font-size: $font-size-32;
+		}
 	}
-
-	.distinguish-button {
+	.section-text {
 		width: 100%;
-		height: 80rpx;
-		margin-top: 100rpx;
+		height: 66rpx;
+		line-height: 66rpx;
+		font-size: $font-size-24;
+		color: #333333;
+	}
+	.section-textarea {
+		width: 100%;
+		height: 200rpx;
 		box-sizing: border-box;
-		padding: 0 50rpx;
-
-		.button {
+		padding: 20rpx;
+		background: #f7f7f7;
+		border-radius: 8rpx;
+		.textarea {
 			width: 100%;
-			height: 80rpx;
-			background: $btn-confirm;
-			border-radius: 40rpx;
-			text-align: center;
-			color: #FFFFFF;
-			line-height: 80rpx;
-			font-size: $font-size-28;
-			box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
-			&.disabled {
-				background: #F7F7F7;
-				color: #e1e1e1;
-			}
+			height: 100%;
 		}
 	}
+}
+
+.distinguish-button {
+	width: 100%;
+	height: 80rpx;
+	margin-top: 100rpx;
+	box-sizing: border-box;
+	padding: 0 50rpx;
 
-	.distinguish-button-text {
+	.button {
 		width: 100%;
 		height: 80rpx;
-		line-height: 80rpx;
+		background: $btn-confirm;
+		border-radius: 40rpx;
 		text-align: center;
-		color: $btn-confirm;
+		color: #ffffff;
+		line-height: 80rpx;
 		font-size: $font-size-28;
+		box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
+		&.disabled {
+			background: #f7f7f7;
+			color: #e1e1e1;
+		}
 	}
+}
 
-	.uni-badge--small {
-		-webkit-transform: scale(.8);
-		-ms-transform: scale(.8);
-		transform: scale(.8);
-		-webkit-transform-origin: center center;
-		-ms-transform-origin: center center;
-		transform-origin: center center;
-	}
+.distinguish-button-text {
+	width: 100%;
+	height: 80rpx;
+	line-height: 80rpx;
+	text-align: center;
+	color: $btn-confirm;
+	font-size: $font-size-28;
+}
 
-	.uni-badge {
-		font-family: 'Helvetica Neue', Helvetica, sans-serif;
-		-webkit-box-sizing: border-box;
-		box-sizing: border-box;
-		font-size: 12px;
-		line-height: 1;
-		display: inline-block;
-		padding: 3px 6px;
-		color: #333;
-		border-radius: 100px;
-		background-color: #f1f1f1;
-	}
+.uni-badge--small {
+	-webkit-transform: scale(0.8);
+	-ms-transform: scale(0.8);
+	transform: scale(0.8);
+	-webkit-transform-origin: center center;
+	-ms-transform-origin: center center;
+	transform-origin: center center;
+}
 
-	.uni-badge-error {
-		color: #fff;
-		background-color: #dd524d;
-	}
+.uni-badge {
+	font-family: 'Helvetica Neue', Helvetica, sans-serif;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+	font-size: 12px;
+	line-height: 1;
+	display: inline-block;
+	padding: 3px 6px;
+	color: #333;
+	border-radius: 100px;
+	background-color: #f1f1f1;
+}
+
+.uni-badge-error {
+	color: #fff;
+	background-color: #dd524d;
+}
 </style>

+ 127 - 84
pages/login/login-account.vue

@@ -1,63 +1,67 @@
 <template>
 	<view class="container" :style="{paddingTop:CustomBar+'px'}">
-		<view class="tui-page-title">登录</view>
-		<view class="tui-form">
-			<view class="tui-view-input">
-				<tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
-					<view class="tui-cell-input">
-						<tui-icon name="mobile" color="#6d7a87" :size="20"></tui-icon>
-						<input
-							:adjust-position="false"
-							v-model="param.mobile"
-							placeholder="请输入账号/手机号"
-							placeholder-class="tui-phcolor"
-							type="text"
-							maxlength="11"
-						/>
-						<view class="" v-show="mobile" @tap="clearInput(1)">
-							<tui-icon name="close-fill" :size="16" color="#bfbfbf"></tui-icon>
+		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="7"></tui-skeleton>
+		<template v-else>
+			<view class="tui-page-title">登录</view>
+			<view class="tui-form">
+				<view class="tui-view-input">
+					<tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
+						<view class="tui-cell-input">
+							<tui-icon name="mobile" color="#6d7a87" :size="20"></tui-icon>
+							<input
+								:adjust-position="false"
+								v-model="param.mobile"
+								placeholder="请输入账号/手机号"
+								placeholder-class="tui-phcolor"
+								type="number"
+								maxlength="11"
+							/>
+							<view class="" v-show="param.mobile" @click.stop="clearInput(1)">
+								<tui-icon name="close-fill" :size="16" color="#bfbfbf" ></tui-icon>
+							</view>
 						</view>
-					</view>
-				</tui-list-cell>
-				<tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
-					<view class="tui-cell-input">
-						<tui-icon name="pwd" color="#6d7a87" :size="20"></tui-icon>
-						<input
-							v-if="isShowEye"
-							:adjust-position="false"
-							v-model="param.password"
-							placeholder="请输入密码"
-							placeholder-class="tui-phcolor"
-							type="text"
-							maxlength="36"
-						/>
-						<input
-							v-if="!isShowEye"
-							:adjust-position="false"
-							v-model="param.password"
-							placeholder="请输入密码"
-							placeholder-class="tui-phcolor"
-							type="password"
-							maxlength="36"
-						/>
-						<view class="" v-show="param.password" style="margin: 0 20rpx 0 0;" @click.stop="changInputType">
-							<tui-icon :name="isShowEye ? 'unseen' : 'eye'" :size="22" color="#bfbfbf"></tui-icon>
+					</tui-list-cell>
+					<tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
+						<view class="tui-cell-input">
+							<tui-icon name="pwd" color="#6d7a87" :size="20"></tui-icon>
+							<input
+								v-if="!isShowEye"
+								:adjust-position="false"
+								v-model="param.password"
+								placeholder="请输入密码"
+								placeholder-class="tui-phcolor"
+								type="text"
+								maxlength="36"
+							/>
+							<input
+								v-if="isShowEye"
+								:adjust-position="false"
+								v-model="param.password"
+								placeholder="请输入密码"
+								placeholder-class="tui-phcolor"
+								type="password"
+								maxlength="36"
+							/>
+							<view class="" v-show="param.password" style="margin: 0 20rpx 0 0;" @click.stop="changInputType">
+								<tui-icon :name="isShowEye ? 'unseen' : 'eye'" :size="22" color="#bfbfbf"></tui-icon>
+							</view>
+							<view class="" v-show="param.password" @click.stop="clearInput(2)">
+								<tui-icon name="close-fill" :size="16" color="#bfbfbf" ></tui-icon>
+							</view>
 						</view>
-						<view class="" v-show="param.password" @click.stop="clearInput(2)">
-							<tui-icon name="close-fill" :size="16" color="#bfbfbf" ></tui-icon>
-						</view>
-					</view>
-				</tui-list-cell>
-			</view>
-			<view class="tui-btn-box">
-				<tui-button type="primary" :disabledGray="true" :disabled="disabled" :shadow="true" shape="circle" @click="hanldeClick">登录</tui-button>
+					</tui-list-cell>
+				</view>
+				<view class="tui-btn-box">
+					<tui-button type="primary" :disabledGray="true" :disabled="disabled" :shadow="true" shape="circle" @click="hanldeClick">登录</tui-button>
+				</view>
 			</view>
-		</view>
+		</template>
 	</view>
 </template>
 
 <script>
 import { mapMutations } from 'vuex'
+import authorize from '@/common/config/authorize.js' 
 export default {
 	computed: {
 		disabled: function() {
@@ -72,11 +76,15 @@ export default {
 		return {
 			CustomBar:this.CustomBar,// 顶部导航栏高度
 			param:{
+				code:null,
+				encryptedData:null,
+				iv:null ,
 				mobile: '',
 				password: '', 
 			},
 			popupShow: false,
 			passwordType:'password',
+			skeletonShow:true,
 			isShowEye:true
 		} 
 	},
@@ -85,48 +93,83 @@ export default {
 	},
 	methods: {
 		...mapMutations(['login', 'logout']),
-		back() {
-			uni.navigateBack()
-		},
-		changInputType(){
-			console.log('222222222222')
-			this.isShowEye = !this.isShowEye
-		},
-		hanldeClick(){
-			
-			this.$api.navigateTo('/pages/collection/sms')
+		async getWxAuthorize(){// 初始化授权登录
+			const WxCode = await authorize.getCode('weixin')
+			const Wx = await authorize.getUserInfo('weixin')
+			this.UserService.UserLoginAuthApplets({ 
+				code:WxCode,
+				encryptedData:Wx.encryptedData,
+				iv:Wx.iv ,
+			})
+			.then(response =>{
+				let data  = response.data
+				this.login(response.data)
+				this.$store.commit('updateStatus',response.data)
+				uni.setStorageSync('openid',response.data.openid)
+				setTimeout(()=>{
+					this.navigateLink(response.data.userType)
+				},500)
+			}).catch(error =>{
+				this.logout()
+				this.skeletonShow = false
+				this.$store.commit('updateStatus',error.data)
+			})
 		},
-		AdminInfo:function(){
-			this.UserService.AccountAdminInfo({}).then(admin =>{
-				this.UserService.AccountFindMerchant(admin.data.id).then(response =>{
-					this.$store.commit('updateStatus',response.data)
-					this.login(response.data)
-					this.$api.switchTabTo('/pages/tabBar/statistics/index')
-				}).catch(err =>{
-					this.$util.msg(err.message,2000)
-				})
+		async UserLoginReceiptPassword(){// 账号密码登录
+			const WxCode = await authorize.getCode('weixin')
+			const Wx = await authorize.getUserInfo('weixin')
+			this.param.code = WxCode
+			this.param.iv = Wx.iv
+			this.param.encryptedData = Wx.encryptedData
+			this.UserService.UserLoginReceiptPassword(this.param).then(response =>{
+				this.login(response.data)
+				this.$store.commit('updateStatus',response.data)
+				uni.setStorageSync('openid',response.data.openid)
+				this.navigateLink(response.data.userType)
 			}).catch(err =>{
-				this.$util.msg(err.message,2000)
+				this.$util.msg(err.msg,2000)
 			})
 		},
-		clearInput(type) {
+		hanldeClick(){//点击登录
+			this.UserLoginReceiptPassword()
+		},
+		navigateLink(userType){// 根据用户权限跳转对应页面
+			/**
+			 * 用户类型 1协销人员,2客服,3财务,4超级管理员
+			 * 1. 协销人员跳转到收款列表页面
+			 * 2. 客服跳转到收款列表页面
+			 * 3. 财务人员跳转到款项识别页面
+			 * 4. 超级管理员跳转到款项识别页面
+			 * */
+			 switch(userType){
+				 case 1:
+					this.$api.navigateTo('/pages/collection/list')
+					break
+				 case 2:
+					this.$api.navigateTo('/pages/collection/list')
+					break
+				 case 3:
+					this.$api.navigateTo('/pages/collection/sms')	
+					break
+				 case 4:
+					this.$api.navigateTo('/pages/collection/sms')
+					break
+					
+			 }
+		},
+		changInputType(){// 控制显示密码
+			this.isShowEye = !this.isShowEye
+		},
+		clearInput(type) {// 清除输入框信息
 			if (type == 1) {
-				this.mobile = ''
+				this.param.mobile = ''
 			} else {
-				this.password = ''
+				this.param.password = ''
 			}
-		},
-		href(type) {
-			let url = '/pages/forgetPwd/forgetPwd'
-			if (type == 2) {
-				url = '/pages/login/login-phone'
-			}
-			this.$api.navigateTo(url)
-		},
-		showOtherLogin() {
-			//打开后 不再关闭
-			this.popupShow = true
 		}
+	},
+	onShow() {
+		this.getWxAuthorize()
 	}
 }
 </script>

+ 2 - 4
pages/relation/nonorder/detail.vue

@@ -445,7 +445,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -457,13 +456,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 2 - 4
pages/relation/order/detail.vue

@@ -467,7 +467,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 	
 		.header-sit-text {
@@ -479,13 +478,12 @@
 	
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 	
 		.icon-iconfonticonfontsousuo1 {

+ 2 - 4
pages/relation/ordinary/detail.vue

@@ -450,7 +450,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -462,13 +461,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 2 - 4
pages/relation/ordinary/examine-detail.vue

@@ -451,7 +451,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -463,13 +462,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 3 - 8
pages/relation/ordinary/index.vue

@@ -16,10 +16,7 @@
 				<view class="tui-header-top">
 					<view class="title"> 收款信息 </view>
 					<view class="tui-header-button">
-						<view class="button btn-error" @click.stop="btnConfirm"> 设为非订单款项 </view>
-						<view class="button btn-confirm" @click="toNoSms('/pages/collection/list')">
-							<text class="iconfont icon-wodedingdan"></text> 收款列表
-						</view>
+						<view class="button btn-confirm" @click.stop="btnConfirm"> 设为非订单款项 </view>
 					</view>
 				</view>
 				<view class="tui-header-item">
@@ -971,7 +968,6 @@ page {
 	height: 80rpx;
 	line-height: 80rpx;
 	box-sizing: border-box;
-	padding: 0 24rpx;
 	color: #ffffff;
 	.header-sit-text {
 		text-align: left;
@@ -981,13 +977,12 @@ page {
 	}
 	.icon-fanhui {
 		display: block;
-		width: 38rpx;
+		width: 80rpx;
 		height: 80rpx;
 		float: left;
-		text-align: left;
+		text-align: center;
 		line-height: 80rpx;
 		font-size: 42rpx;
-		margin-right: 15rpx;
 	}
 }
 

+ 2 - 4
pages/relation/refund/detail.vue

@@ -439,7 +439,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -451,13 +450,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 4 - 6
pages/relation/refund/index.vue

@@ -15,11 +15,11 @@
 			<view v-if="!isShowHeader">
 				<view class="tui-header-top">
 					<view class="title"> 收款信息 </view>
-					<view class="tui-header-button">
+					<!-- <view class="tui-header-button">
 						<view class="button btn-confirm" @click="toNoSms('/pages/collection/list')">
 							<text class="iconfont icon-wodedingdan"></text> 收款列表
 						</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="tui-header-item">
 					<view class="list-title-t">
@@ -790,7 +790,6 @@ page {
 	height: 80rpx;
 	line-height: 80rpx;
 	box-sizing: border-box;
-	padding: 0 24rpx;
 	color: #ffffff;
 	.header-sit-text {
 		text-align: left;
@@ -800,13 +799,12 @@ page {
 	}
 	.icon-fanhui {
 		display: block;
-		width: 38rpx;
+		width: 80rpx;
 		height: 80rpx;
 		float: left;
-		text-align: left;
+		text-align: center;
 		line-height: 80rpx;
 		font-size: 42rpx;
-		margin-right: 15rpx;
 	}
 }
 

+ 2 - 4
pages/relation/return/detail.vue

@@ -439,7 +439,6 @@
 		height: 80rpx;
 		line-height: 80rpx;
 		box-sizing: border-box;
-		padding: 0 24rpx;
 		color: #ffffff;
 
 		.header-sit-text {
@@ -451,13 +450,12 @@
 
 		.icon-fanhui {
 			display: block;
-			width: 38rpx;
+			width: 80rpx;
 			height: 80rpx;
 			float: left;
-			text-align: left;
+			text-align: center;
 			line-height: 80rpx;
 			font-size: 42rpx;
-			margin-right: 15rpx;
 		}
 
 		.icon-iconfonticonfontsousuo1 {

+ 4 - 6
pages/relation/return/index.vue

@@ -15,11 +15,11 @@
 			<view v-if="!isShowHeader">
 				<view class="tui-header-top">
 					<view class="title"> 收款信息 </view>
-					<view class="tui-header-button">
+					<!-- <view class="tui-header-button">
 						<view class="button btn-confirm" @click="toNoSms('/pages/collection/list')">
 							<text class="iconfont icon-wodedingdan"></text> 收款列表
 						</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="tui-header-item">
 					<view class="list-title-t">
@@ -782,7 +782,6 @@ page {
 	height: 80rpx;
 	line-height: 80rpx;
 	box-sizing: border-box;
-	padding: 0 24rpx;
 	color: #ffffff;
 	.header-sit-text {
 		text-align: left;
@@ -792,13 +791,12 @@ page {
 	}
 	.icon-fanhui {
 		display: block;
-		width: 38rpx;
+		width: 80rpx;
 		height: 80rpx;
 		float: left;
-		text-align: left;
+		text-align: center;
 		line-height: 80rpx;
 		font-size: 42rpx;
-		margin-right: 15rpx;
 	}
 }
 

+ 4 - 4
services/config.env.js

@@ -1,10 +1,10 @@
 let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-    // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
-    // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
-    // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-    URL_CONFIG = 'https://core-b.caimei365.com'
+    // URL_CONFIG = 'http://192.168.2.67:18014'	 //智捷联调地址
+    // URL_CONFIG = 'http://192.168.2.68:18014'	 //涛涛联调地址
+    URL_CONFIG = 'http://192.168.2.75:18014'	 //超超联调地址
+    // URL_CONFIG = 'https://core-b.caimei365.com'
     // URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境

+ 7 - 0
services/index.js

@@ -1,6 +1,13 @@
 import ajaxService from './ajax.service.js'
 import UserService from './user.service'
+import OrderService from './order.service'
 import Vue from 'vue'
+
 let userService = new UserService(ajaxService)
+let orderService = new OrderService(ajaxService)
+
+
+// 
 Vue.prototype.AjaxService = ajaxService
 Vue.prototype.UserService = userService
+Vue.prototype.OrderService = orderService

+ 45 - 0
services/order.service.js

@@ -0,0 +1,45 @@
+/**
+ * 这是与购物有关的业务逻辑的服务
+ */
+export default class OrderService {
+    constructor(AjaxService) {
+        Object.assign(this, { AjaxService })
+        this.name = 'OrderService'
+    }
+    /* 识别收款短信 */
+    orderReceiptReadSms (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/receipt/read/sms', 
+            data, 
+            isLoading: true ,
+            loadText: '识别中...'
+              
+        })
+    }
+    /* 获取收款类型 */
+    orderReceiptType (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/receipt/type', 
+            data, 
+            isLoading: true ,
+              
+        })
+    }
+    /* 获取收款类型 */
+    orderReceiptSave(data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/receipt/save', 
+            data, 
+            isLoading: true ,
+            loadText: '保存中...' 
+        })
+    }
+    /* 获取收款详情 */
+    orderReceiptDetail(data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/receipt/detail', 
+            data, 
+            isLoading: true ,
+        })
+    }
+}

+ 21 - 5
services/user.service.js

@@ -3,12 +3,28 @@
  */
 export default class UserService {
     constructor(AjaxService) {
-        Object.assign(this, { AjaxService })
+        Object.assign(this, {
+            AjaxService
+        })
         this.name = 'UserService'
     }
-    /* 微信一键登录 */ 
-    appSelectLoginUser (data = {}) {
-        return this.AjaxService.post({ url:'/sso/AppletsloginUsers', data, isLoading: true ,json: false })
+    /* 初始化授权登录 */
+    UserLoginAuthApplets(data = {}) {
+        return this.AjaxService.post({
+            url: '/order/receipt/auth',
+            data,
+            isLoading: false,
+
+        })
     }
+    /* 账号密码登录 */
+    UserLoginReceiptPassword(data = {}) {
+        return this.AjaxService.post({
+            url: '/order/receipt/password',
+            data,
+            isLoading: false,
+            loadText:'登录中...'
 
-}
+        })
+    }
+}

+ 3 - 25
store/index.js

@@ -9,10 +9,8 @@ const store = new Vuex.Store({
         isWxAuthorize: false,
         hasLogin: false,
         userInfo: {},
-        identity: 0,
-        clubType: 0, // 1: 医美机构  2:生美机构 (医美、生美机构类型)
+        openid: 0,
         wechatUserInfo: {},
-        cartNumber: 0,
         isIphoneX: false,
         isActivity: false,
         isLoginType: 0,
@@ -50,19 +48,8 @@ const store = new Vuex.Store({
             let TIME = api.formatDate()
             console.log(`${TIME}`, provider)
             state.userInfo = provider
-            if (state.userInfo) {
-                state.clubType = provider.firstClubType
-                if (provider.userIdentity) {
-                    state.identity = provider.userIdentity
-                } else if (provider.userId == 5261 || provider.userId == 10947 || provider.userId == 11579) {
-                    state.identity = 1
-                } else if (provider.firstClubType == 1) {
-                    state.identity = 5
-                } else {
-                    state.identity = 0
-                }
-            }
-            console.log('用户类型', state.identity)
+            state.openid = provider.openid
+            console.log('用户微信openid', state.openid)
             uni.setStorage({ //缓存用户登陆状态
                 key: 'userInfo',
                 data: provider
@@ -85,9 +72,6 @@ const store = new Vuex.Store({
                 })
             }
         },
-        setActivity(state, variable) { // 记录活动弹窗状态
-            state.isActivity = variable
-        },
         setChangeVar(state, variable) {
             state.isIphoneX = variable
         },
@@ -114,12 +98,6 @@ const store = new Vuex.Store({
         setIsIphoneFun: function(context, vData) {
             context.commit('setIsIphone', vData)
         },
-        setActivityFn: function(context, vData) {
-            context.commit('setActivity', vData)
-        },
-        // setLoginTypeFn:function(context,vData){
-        // 	context.commit('setLoginType',vData)
-        // }
     }
 })