Browse Source

Merge branch 'master' of http://git.jihengcc.cn/liubaiyan/qjd-shell-uniapp

able99 4 years ago
parent
commit
59920d81e3

+ 89 - 0
components/CnumberBox.vue

@@ -0,0 +1,89 @@
+<template>
+	<view class="main">
+		<uni-icons type="minus-filled" size="20" color="#A67A54" @click="numReduce"></uni-icons>
+		<!-- <text class="buy-select">{{number}}</text> -->
+		<!-- <u-input
+		  v-model="number"
+		  type="number"
+		  height="40"
+		  :placeholder="placeholder"
+		  :clearable="false"
+		  :disabled="isDisabled"
+		  input-align="center"
+		  :custom-style="{width:'45px'}"
+		  @input="onKeyInput"/> -->
+		 <input class="uni-input" v-model="number" :type="isInt?'number' : 'digit'" :disabled="isDisabled" :placeholder="placeholder" @input="onKeyInput" >
+		<uni-icons type="plus-filled" size="20" color="#A67A54" @click="numPlus"></uni-icons>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			// number: {
+			// 	default: 1
+			// },
+			isDisabled: {
+				default: false
+			},
+			isInt: {
+				default: true
+			},
+			placeholder: {
+				default: ''
+			},
+			step: {
+				default: 1
+			},
+			minNum: {
+				default: 0.01
+			}
+		},
+		data() {
+			return {
+			    number: 1,
+			}
+		},
+		methods: {
+			onKeyInput(event) {
+				// uniapp的input用这个
+				let i = event.target.value
+				// u-view的input用这个
+				// let i = event
+				let num = i.charAt(i.length-1)
+				var reg=new RegExp("^[0-9]*$")
+				if(!reg.test(num)) {
+					this.number =  i.slice(0,-1)
+				} else {
+					this.number = i
+				}
+				this.$emit('getNum',this.number);
+			},
+			numPlus() {
+			    this.number = (Number(this.number) + Number(this.step))
+				this.$emit('getNum',this.number);
+			},
+			numReduce() {
+			    if ((Number(this.number) - Number(this.step)) >= Number(this.minNum)) {
+				    this.number = (Number(this.number) - Number(this.step))
+			    }
+				this.$emit('getNum',this.number);
+			}
+		}
+	}
+</script>
+
+<style>
+</style>
+<style lang="less" scoped>
+	.main {
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+		.uni-input {
+			height: 40px;
+			width: 45px;
+			text-align: center;
+		}
+	}
+</style>

+ 7 - 3
config/api.js

@@ -1,7 +1,8 @@
-// const WX_API_BASE = 'https://www.qianjiadi.com/'
+const WX_API_BASE = 'https://www.qianjiadi.com/'
 // const WX_API_BASE = 'http://ch.jihengcc.cn:17080/'
 // const WX_API_BASE = 'https://test.jihengcc.cn/'
- const WX_API_BASE = 'https://www.qianjiadi.com/'
+ // const WX_API_BASE = 'https://www.qianjiadi.com/'
+ // const WX_API_BASE = 'http://172.18.1.79:8765/'
 
 module.exports = {
 	//  微信登录
@@ -75,6 +76,8 @@ module.exports = {
 	creatPickVideo: WX_API_BASE + 'app/liveAndVideo/merchant/addPickLive',
 	//  自助采摘直播获取个人信息
 	getMainInfo: WX_API_BASE + 'app/member/selectUserById/',
+	//  小程序-商户端-发起直播推送给订阅用户推送消息
+	startLivePushMessage: WX_API_BASE + '/app/liveAndVideo/startLivePushMessage/',
     // 我的-查询各状态订单数量
 	getOrderNum: WX_API_BASE + 'app/order/user/my/queryOrderStatus/',
 	
@@ -90,7 +93,8 @@ module.exports = {
 	addMessage: WX_API_BASE + 'app/order/user/my/orderList/orderDetail/leaMsgList/addLeaMsg',
 	//  获取订单详情
 	getOrderDetail: WX_API_BASE + 'app/order/user/my/orderList/orderDetail',
-
+    //  编辑订单数量
+	editOrder: WX_API_BASE + 'app/order/user/editOrder',
 
 	//  查询优惠券列表
 	getCouponList: WX_API_BASE + 'app/merchants/merchantsCouponGrantPage',

+ 1 - 1
pages.json

@@ -19,7 +19,7 @@
 		{
 			"path": "pages/media/index",
 			"style": {
-				"navigationBarTitleText": "多媒体",
+				"navigationBarTitleText": "直播和短视频",
 				"enablePullDownRefresh": true
 			}
 		},

+ 22 - 10
pages/index/home.vue

@@ -21,8 +21,8 @@
 				 @click="setType(item, 1)">{{item.label}}</view>
 			</view>
 			<view class="chart-box">
-				<canvas canvas-id="chartBox1" id="chartBox1" class="chart-canvas" @touchstart="touchLine1"
-				 @touchmove="moveLine1" @touchend="touchEndLine1" force-use-old-canvas="true"></canvas>
+				<canvas canvas-id="chartBox1" id="chartBox1" class="chart-canvas" @touchstart="touchLine1" @touchmove="moveLine1"
+				 @touchend="touchEndLine1" force-use-old-canvas="true"></canvas>
 			</view>
 		</view>
 		<view class="index-data-box">
@@ -32,8 +32,8 @@
 				 @click="setType(item, 2)">{{item.label}}</view>
 			</view>
 			<view class="chart-box">
-				<canvas canvas-id="chartBox2" id="chartBox2" class="chart-canvas" @touchstart="touchLine2"
-				 @touchmove="moveLine2" @touchend="touchEndLine2" force-use-old-canvas="true"></canvas>
+				<canvas canvas-id="chartBox2" id="chartBox2" class="chart-canvas" @touchstart="touchLine2" @touchmove="moveLine2"
+				 @touchend="touchEndLine2" force-use-old-canvas="true"></canvas>
 			</view>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
@@ -71,7 +71,8 @@
 			}
 		},
 		onLoad() {
-			if (!uni.getStorageSync('token') || uni.getStorageSync('userData').registerFlag != 1 || uni.getStorageSync('userData').auditState != 2) {
+			if (!uni.getStorageSync('token') || uni.getStorageSync('userData').registerFlag != 1 || uni.getStorageSync(
+					'userData').auditState != 2) {
 				uni.reLaunch({
 					url: '/pages/index/index'
 				});
@@ -83,7 +84,7 @@
 			this.setData(2, 'creat')
 		},
 		onShow() {
-			this.userData = uni.getStorageSync("userData")||{}
+			this.userData = uni.getStorageSync("userData") || {}
 			this.getShopInfo()
 		},
 		onPullDownRefresh() {
@@ -108,7 +109,7 @@
 			},
 			//  跳转商品管理
 			goToGoodList() {
-				if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '商品管理'))){
+				if (!this.userData.roleInfos.some(v => v.menuInfos.some(vv => vv.label == '商品管理'))) {
 					this.$refs.uTips.show({
 						title: '没有授权使用,请联系商户负责人',
 						type: 'warning',
@@ -122,7 +123,7 @@
 			},
 			//  跳转商品管理
 			goToOrderList() {
-				if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '订单管理'))){
+				if (!this.userData.roleInfos.some(v => v.menuInfos.some(vv => vv.label == '订单管理'))) {
 					this.$refs.uTips.show({
 						title: '没有授权使用,请联系商户负责人',
 						type: 'warning',
@@ -145,7 +146,7 @@
 						return site.time
 					})
 					let data = res.data.map(site => {
-						return type1 == 1 ? site.orderSum : site.no
+						return type1 == 1 ? site.no : site.orderSum
 					})
 					if (type2 == 'creat') {
 						this.creatChart(type1, column, data)
@@ -153,6 +154,7 @@
 						let option = {
 							categories: column,
 							scrollPosition: 'left',
+							yAxis: {},
 							series: [{
 								name: "",
 								color: "#52A63A",
@@ -174,6 +176,8 @@
 			},
 			//  创建图表
 			creatChart(type, column, data) {
+				console.log(data)
+				let maxNum = (Math.ceil(Math.max(...data)/5))*5
 				let option = {
 					$this: _self,
 					canvasId: "chartBox" + type,
@@ -196,7 +200,15 @@
 						scrollBackgroundColor: '#DEE7F7',
 						scrollColor: '#52A63A',
 					},
-					yAxis: {},
+					yAxis: {
+						format: (val) => {
+							return parseFloat(val.toFixed(2))
+							// return (type == 1 ? parseInt(val) : parseFloat(val.toFixed(2)))
+						},
+						min:0,
+			            max:maxNum,
+						splitNumber: 5
+					},
 					categories: column,
 					legend: {
 						show: false

+ 1 - 0
pages/index/index copy.vue

@@ -81,6 +81,7 @@
 							headImage: res.extra.auth2.merchantImg,
 							userName: res.data.name,
 							userId: res.data.userId,
+							tenantName: res.data.tenantName,
 							isMaster: res.extra.auth.isMaster,
 							registerFlag: res.extra.auth.registerFlag,
 							auditState: res.extra.auth.auditState,

+ 2 - 0
pages/index/index.vue

@@ -295,6 +295,7 @@
 							uni.login({
 								provider: 'weixin',
 								success: (res2) => {
+									console.log("1234444",res2)
 									let wxLoginData = {
 										code: res2.code,
 										encryptedData: data.detail.encryptedData,
@@ -399,6 +400,7 @@
 							headImage: res.extra.auth2.merchantImg,
 							userName: res.data.name,
 							userId: res.data.userId,
+							tenantName: res.data.tenantName,
 							isMaster: res.extra.auth.isMaster,
 							registerFlag: res.extra.auth.registerFlag,
 							auditState: res.extra.auth.auditState,

+ 135 - 168
pages/index/register.vue

@@ -1,60 +1,62 @@
 <template>
 	<view class="container">
-		<u-cell-group class="form-info" :border="false">
-		    <u-form :model="shopInfo" ref="shopInfo">
-				<!-- <u-form-item label="商家名称" prop="name">
-				  <u-input placeholder="请输入商家名称" label-width="180" v-model="shopInfo.name" /> -->
-				  <u-field label="商家名称" required placeholder="请输入商家名称" label-width="180" v-model="shopInfo.name"></u-field>
-				<!-- </u-form-item> -->
-				<u-cell-item title="请上传商家图标" :arrow="false">
-					<view slot="label">
-						<u-upload :action="uploadUrl" :file-list="defaultList1" :form-data="uploadData" @on-success="logoUploadSuccess"
-						 @on-error="uploadError" max-count="1"></u-upload>
-					</view>
-				</u-cell-item>
-				<u-cell-item title="请上传店铺主图" :arrow="false" class="all-width">
-					<view slot="label">
-						<u-upload :action="uploadUrl" :file-list="defaultList2" :form-data="uploadData" @on-success="uploadSuccess"
-						 @on-error="uploadError" @on-remove="uploadRemove" max-count="3"></u-upload>
-					</view>
-				</u-cell-item>
-				<u-cell-item title="请上传身份证正反面" :arrow="false" class="all-width">
-					<view slot="label" class="id-card-box">
-						<u-upload :action="uploadUrl" :file-list="defaultList3" :form-data="uploadData" @on-success="uploadIdCardSuccess1"
-						 @on-error="uploadError" :custom-btn="true" max-count="1" style="margin-right: 16px;" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px'}">
-							<view slot="addBtn" class="id-card card-img1" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px', paddingTop: (cWidth * 0.66) + 'px', backgroundSize: '100% ' + (cWidth * 0.66) + 'px'}">拍摄正面</view>
-						</u-upload>
-						<u-upload :action="uploadUrl" :file-list="defaultList4" :form-data="uploadData" @on-success="uploadIdCardSuccess2"
-						 @on-error="uploadError" :custom-btn="true" max-count="1" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px'}">
-							<view slot="addBtn" class="id-card card-img2" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px', paddingTop: (cWidth * 0.66) + 'px', backgroundSize: '100% ' + (cWidth * 0.66) + 'px'}">拍摄反面</view>
-						</u-upload>
-					</view>
-				</u-cell-item>
-				<u-cell-item title="请上传营业执照照片" required :arrow="false" class="all-width">
-					<view slot="label" class="license-box">
-						<u-upload :action="uploadUrl" :file-list="defaultList5" :form-data="uploadData" @on-success="uploadLicenseSuccess"
-						 @on-error="uploadError" :custom-btn="true" max-count="1" class="diy-upload">
-							<image slot="addBtn" class="license-img" src="../../static/images/license-img.png"></image>
-						</u-upload>
-						<view class="license-text"> 营业执照</view>
-					</view>
-				</u-cell-item>
-				<u-field label="法人姓名" required placeholder="请输入法人姓名" label-width="180" v-model="shopInfo.duty"></u-field>
-				<u-cell-item title="所在城市" required @click="regionShow = true">
-					<text v-show="shopInfo.companyAddressProvince">{{shopInfo.companyAddressProvince}}-{{shopInfo.companyAddressCity}}-{{shopInfo.companyAddressDistrict}}</text>
-				</u-cell-item>
-				<!-- <u-form-item label="联系方式" prop="contactTel"> -->
-				<u-field label="联系方式" required :error-message="errorMessage1" placeholder="请输入联系方式" label-width="180" v-model="shopInfo.contactTel"></u-field>
-					<!-- <input type="number" placeholder="请输入联系方式" label-width="180" v-model="shopInfo.contactTel" /> -->
-				<!-- </u-form-item> -->
-				<u-field label="收款人姓名" required placeholder="请输入收款人姓名" label-width="180" v-model="shopInfo.collectionName"></u-field>
-				<u-field label="户名" required placeholder="请输入户名" label-width="180" v-model="shopInfo.bankAccountName"></u-field>
-				<u-field label="银行名称" required placeholder="请输入银行名称" label-width="180" v-model="shopInfo.bankAllName"></u-field>
-				<u-field label="银行卡号" required :error-message="errorMessage2" placeholder="请输入银行卡号" label-width="180" v-model="shopInfo.bankNumber"></u-field>
-			</u-form>
-		</u-cell-group>
-		<view class="form-handle">
-			<u-button type="success" shape="circle" :ripple="true" @click="submitData" class="handle-custom">提交</u-button>
+		<u-form :model="shopInfo" ref="shopInfo" label-width="180">
+			<u-form-item label="商家名称" prop="name" required>
+				<u-input v-model="shopInfo.name" type="text" placeholder="请输入商家名称" />
+			</u-form-item>
+			<u-form-item label="请上传商家图标" placeholder="请上传商家图标" required label-position="top">
+				<u-upload :action="uploadUrl" :file-list="defaultList1" :form-data="uploadData" @on-success="logoUploadSuccess"
+				 @on-error="uploadError" max-count="1"></u-upload>
+			</u-form-item>
+			<u-form-item label="请上传店铺主图" placeholder="请上传店铺主图" required label-position="top">
+				<u-upload :action="uploadUrl" :file-list="defaultList2" :form-data="uploadData" @on-success="uploadSuccess"
+				 @on-error="uploadError" @on-remove="uploadRemove" max-count="3"></u-upload>
+			</u-form-item>
+			<u-form-item label="请上传身份证正反面" placeholder="请上传身份证正反面" required label-position="top">
+				<view class="id-card-box">
+					<u-upload :action="uploadUrl" :file-list="defaultList3" :form-data="uploadData" @on-success="uploadIdCardSuccess1"
+					 @on-error="uploadError" :custom-btn="true" max-count="1" style="margin-right: 16px;" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px'}">
+						<view slot="addBtn" class="id-card card-img1" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px', paddingTop: (cWidth * 0.66) + 'px', backgroundSize: '100% ' + (cWidth * 0.66) + 'px'}">拍摄正面</view>
+					</u-upload>
+					<u-upload :action="uploadUrl" :file-list="defaultList4" :form-data="uploadData" @on-success="uploadIdCardSuccess2"
+					 @on-error="uploadError" :custom-btn="true" max-count="1" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px'}">
+						<view slot="addBtn" class="id-card card-img2" :style="{width: cWidth + 'px', height: (cWidth * 0.66 + 30) + 'px', paddingTop: (cWidth * 0.66) + 'px', backgroundSize: '100% ' + (cWidth * 0.66) + 'px'}">拍摄反面</view>
+					</u-upload>
+				</view>
+			</u-form-item>
+			<u-form-item label="请上传营业执照照片" placeholder="请上传营业执照照片" label-position="top">
+				<view class="license-box">
+					<u-upload :action="uploadUrl" :file-list="defaultList5" :form-data="uploadData" @on-success="uploadLicenseSuccess"
+					 @on-error="uploadError" :custom-btn="true" max-count="1" class="diy-upload">
+						<image slot="addBtn" class="license-img" src="../../static/images/license-img.png"></image>
+					</u-upload>
+					<view class="license-text"> 营业执照</view>
+				</view>
+			</u-form-item>
+			<u-form-item label="法人姓名" prop="duty" required>
+				<u-input v-model="shopInfo.duty" type="text" placeholder="请输入法人姓名" />
+			</u-form-item>
+			<u-form-item label="所在城市" placeholder="请选择所在城市" right-icon="arrow-right" required @click.native="regionShow = true">
+				<text v-show="shopInfo.companyAddressProvince">{{shopInfo.companyAddressProvince}}-{{shopInfo.companyAddressCity}}-{{shopInfo.companyAddressDistrict}}</text>
+			</u-form-item>
+			<u-form-item label="联系方式" prop="contactTel" required>
+				<u-input v-model="shopInfo.contactTel" type="text" placeholder="请输入联系方式" />
+			</u-form-item>
+			<u-form-item label="收款人姓名" prop="collectionName" required>
+				<u-input v-model="shopInfo.collectionName" type="text" placeholder="请输入收款人姓名" />
+			</u-form-item>
+			<u-form-item label="户名" prop="bankAccountName" required>
+				<u-input v-model="shopInfo.bankAccountName" type="text" placeholder="请输入户名" />
+			</u-form-item>
+			<u-form-item label="银行名称" prop="bankAllName" required>
+				<u-input v-model="shopInfo.bankAllName" type="text" placeholder="请输入银行名称" />
+			</u-form-item>
+			<u-form-item label="银行卡号" prop="bankNumber" required>
+				<u-input v-model="shopInfo.bankNumber" type="text" placeholder="请输入银行卡号" />
+			</u-form-item>
+		</u-form>
+		<view class="handle-fix-box">
+			<u-button type="success" shape="circle" :ripple="true" :custom-style="customStyle" @click="submitData">提交</u-button>
 		</view>
 		<u-picker mode="region" v-model="regionShow" @confirm="setRegion"></u-picker>
 		<u-top-tips ref="uTips"></u-top-tips>
@@ -97,22 +99,24 @@
 				defaultList4: [],
 				defaultList5: [],
 				rules: {
-					name: [
-						{ 
-							required: true, 
-							message: '请输入姓名', 
-							// 可以单个或者同时写两个触发验证方式 
-							trigger: 'blur',
-						}
-					]
+					name: [{
+						required: true,
+						message: '请输入姓名',
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: 'blur',
+					}]
 				},
 				errorMessage1: '',
-				errorMessage2: ''
+				errorMessage2: '',
+				customStyle: { //  底部悬浮按钮样式
+					height: '40px',
+					backgroundColor: '#56a83a'
+				}
 			}
 		},
 		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
 		onReady() {
-		  // this.$refs.shopInfo.setRules(this.rules);
+			// this.$refs.shopInfo.setRules(this.rules);
 		},
 		onLoad(options) {
 			this.cWidth = (uni.upx2px(750) - 40) / 2;
@@ -228,10 +232,9 @@
 			},
 			//  提交
 			submitData() {
-				debugger
 				let required = true
 				for (let key in this.shopInfo) {
-					if (!this.shopInfo[key]) {
+					if (!this.shopInfo[key] && key != 'businessLicenseCopyFilePath') {
 						required = false
 					}
 				}
@@ -312,134 +315,98 @@
 		},
 	}
 </script>
-
-<style lang="less" scoped>
+<style>
 	page {
 		width: 100%;
 		height: 100%;
 	}
-
+</style>
+<style lang="less" scoped>
 	.container {
 		width: 100%;
-		height: 100%;
 		float: left;
-		overflow-y: auto;
+		padding: 0 15px 60px 15px;
 
-		.form-info {
-			width: 100%;
-			float: left;
+		.id-card-box {
+			display: flex;
 
-			/deep/.u-label-text {
-				color: #333333;
-				line-height: 40px;
+			.id-card {
+				height: 140px;
+				margin-right: 10px;
+				box-sizing: border-box;
+				padding-top: 110px;
+				background-color: #51A539;
+				background-size: 100% 110px;
+				background-position: center top;
+				background-repeat: no-repeat;
+				border-radius: 6px;
 				font-size: 15px;
+				font-family: PingFang SC;
+				color: #FFFFFF;
+				line-height: 30px;
+				text-align: center;
 			}
 
-			/deep/.u-cell_title {
-				color: #333333;
-				line-height: 40px;
-				font-size: 15px;
+			.card-img1 {
+				background-image: url(@/static/images/card-img1.png);
 			}
 
-			.id-card-box {
-				display: flex;
-
-				.id-card {
-					height: 140px;
-					margin-right: 10px;
-					box-sizing: border-box;
-					padding-top: 110px;
-					background-color: #51A539;
-					background-size: 100% 110px;
-					background-position: center top;
-					background-repeat: no-repeat;
-					border-radius: 6px;
-					font-size: 15px;
-					font-family: PingFang SC;
-					color: #FFFFFF;
-					line-height: 30px;
-					text-align: center;
-				}
-
-				.card-img1 {
-					background-image: url(@/static/images/card-img1.png);
-				}
-
-				.card-img2 {
-					background-image: url(@/static/images/card-img2.png);
-				}
-
-				/deep/.u-list-item {
-					width: 100% !important;
-					height: 110px !important;
-				}
+			.card-img2 {
+				background-image: url(@/static/images/card-img2.png);
 			}
 
-			.license-box {
-				width: 100%;
-				height: 175px;
-				position: relative;
-
-				.diy-upload {
-					width: 100%;
-					height: 145px;
-					position: absolute;
-				}
+			/deep/.u-list-item {
+				width: 100% !important;
+				height: 110px !important;
+			}
+		}
 
-				.license-img {
-					width: 100%;
-					height: 145px;
-					position: absolute;
-				}
+		.license-box {
+			width: 100%;
+			height: 175px;
+			position: relative;
 
-				/deep/.u-list-item {
-					width: 100% !important;
-					height: 145px !important;
-				}
+			.diy-upload {
+				width: 100%;
+				height: 145px;
+				position: absolute;
 			}
 
-			.license-text {
+			.license-img {
 				width: 100%;
-				height: 30px;
-				margin-top: 5px;
-				font-size: 15px;
-				font-family: PingFang SC;
-				color: #656565;
-				line-height: 30px;
-				text-align: center;
-				position: relative;
-				top: 145px;
+				height: 145px;
+				position: absolute;
 			}
-		}
-
-		.form-handle {
-			width: calc(100% - 30px);
-			float: left;
-			height: 40px;
-			margin: 30px 15px 20px 15px;
-
-
-			.handle-custom {
-				background-color: #51A539;
-
-				/deep/button {
-					background-color: #56a83a;
-				}
 
-				/deep/.u-btn--success--disabled {
-					background-color: #74bd60 !important;
-				}
+			/deep/.u-list-item {
+				width: 100% !important;
+				height: 145px !important;
 			}
+		}
 
-			// /deep/.u-btn--success--disabled {
-			// 	background-color: #999999 !important;
-			// }
+		.license-text {
+			width: 100%;
+			height: 30px;
+			margin-top: 5px;
+			font-size: 15px;
+			font-family: PingFang SC;
+			color: #656565;
+			line-height: 30px;
+			text-align: center;
+			position: relative;
+			top: 145px;
 		}
-	}
 
-	.all-width {
-		/deep/.u-cell_title {
-			width: 100% !important;
+		.handle-fix-box {
+			width: 100%;
+			box-sizing: border-box;
+			padding: 10px 15px;
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			height: 60px;
+			background-color: #FFFFFF;
+			z-index: 999;
 		}
 	}
 </style>

+ 151 - 3
pages/media/index.vue

@@ -44,6 +44,22 @@
 			</view>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
+		<view class="uni-popup-dialog" :hidden="show_qx">
+			<view class="uni-dialog-title">
+				<text class="uni-dialog-title-text">提示</text>
+			</view>
+			<view class="uni-dialog-content">
+				<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+			</view>
+			<view class="uni-dialog-button-group">
+				<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+					设置权限
+				</button>
+			</view>
+		
+		</view>
+		<view class="qx_bg" :hidden="show_qx">
+		</view>
 	</view>
 	</view>
 </template>
@@ -54,6 +70,7 @@
 	export default {
 		data() {
 			return {
+				show_qx:true,
 				liveId: '',
 				pageIndex: 1,
 				isOver: false,
@@ -71,6 +88,9 @@
 			this.getBaseData('refresh')
 		},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			goManage() {
 				if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '短视频'))){
 					this.$refs.uTips.show({
@@ -130,9 +150,30 @@
 				}
 
 				if (this.liveId) {
-					uni.navigateTo({
-						url: '/pagesMedia/liveDetail?liveId=' + this.liveId
-					});
+					var that=this;
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/liveDetail?liveId=' + that.liveId
+						});
+					}else{
+						wx.getSetting({
+						  success(res) {
+							if (!res.authSetting['scope.camera']){
+							  that.show_qx=false;
+							}else if (!res.authSetting['scope.record']){
+							  that.show_qx=false;
+							}else{
+								uni.navigateTo({
+									url: '/pagesMedia/liveDetail?liveId=' + that.liveId
+								});
+							}
+						  }
+						})
+					}
 				} else {
 					this.$refs.uTips.show({
 						title: '当前无可进行的直播',
@@ -370,4 +411,111 @@
 			}
 		}
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 11;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 10;
+	}
 </style>

+ 5 - 3
pages/user/index.vue

@@ -3,7 +3,7 @@
 		<view class="user-info-box">
 			<image class="user-image" :src="userData.headImage"></image>
 			<view class="user-info">
-				<view class="user-logoin-title">{{userData.userName}}</view>
+				<view class="user-logoin-title">{{userData.tenantName}}</view>
 				<view class="user-type">
 					<view class="iconfont iconshangjia-shanghu"></view>
 					<view>商家用户</view>
@@ -39,7 +39,8 @@
 		<view class="cell-group">
 			<view class="item-btn" @click="pickClick()">
 				<view class="iconfont iconcaizhai item-btn-icon"></view>
-				<view class="item-btn-text">自助采摘</view>
+				<view class="item-btn-text" v-if="num.selfOrder">自助采摘 ({{num.selfOrder}})</view>
+				<view class="item-btn-text" v-if="!num.selfOrder">自助采摘</view>
 				<view class="iconfont iconfangxiang"></view>
 			</view>
 			<view class="item-btn" @click="authorizeClick()" v-if="userData.isMaster">
@@ -95,7 +96,8 @@
 					unPay: 0,  // 待付款
 					unReceive: 0, // 待收货
 					unSend: 0, // 待发货
-					finished: 0 // 已评价
+					finished: 0, // 已评价
+					selfOrder: 0,// 自助采摘订单
 				}
 			}
 		},

+ 88 - 72
pagesGood/goodForm.vue

@@ -1,42 +1,56 @@
 <template>
 	<view class="container">
-		<u-cell-group class="form-info" :border="false">
-			<u-field label="商品名称" placeholder="请输入商品名称" :disabled="ifEdit()" label-width="180" v-model="goodInfo.productName"></u-field>
-			<u-cell-item title="请上传商品图片(上限5张)" :arrow="false">
-				<view slot="label">
+		<u-form :model="goodInfo" ref="goodInfo" label-width="240">
+			<u-form-item label="商品名称" prop="productName" required>
+				<u-input v-model="goodInfo.productName" type="text" placeholder="请输入商品名称" :disabled="ifEdit()"/>
+			</u-form-item>
+			<u-form-item label="请上传商品图片(上限5张)" required label-position="top">
+				<view>
 					<u-image width="98px" height="98px" border-radius="5px" v-for="(item, index) in fileList" :src="item" class="good-img"
 					 v-if="ifEdit()"></u-image>
 					<u-upload :action="uploadUrl" :file-list="defaultList" :form-data="uploadData" @on-success="uploadSuccess"
 					 @on-error="uploadError" @on-remove="uploadRemove" max-count="5" :disabled="ifEdit()"></u-upload>
 				</view>
-			</u-cell-item>
-			<u-cell-item title="原价" :arrow="false">
-				<u-number-box :positive-integer="false" :min="0.01" step="1" v-model="goodInfo.originalPrice" bg-color="#51A539"
-				 color="#ffffff" :disabled="ifEdit()" digit></u-number-box>
-			</u-cell-item>
-			<u-cell-item :title="formType == 1 ? '售价' : '采摘价格'" :arrow="false" v-if="formType != 2">
-				<u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.bizPrice" bg-color="#51A539" color="#ffffff"
-				 :disabled="ifEdit()" digit></u-number-box>
-			</u-cell-item>
-			<u-cell-item title="起拍价" :arrow="false" v-if="formType == 2">
-				<u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.auctionStartPrice" bg-color="#51A539" color="#ffffff"
-				 :disabled="ifEdit()" digit></u-number-box>
-			</u-cell-item>
-			<u-cell-item title="每次最低加价金额" :arrow="false" v-if="formType == 2">
-				<u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.auctionMinAddPrice" bg-color="#51A539" color="#ffffff"
-				 :disabled="ifEdit()" digit></u-number-box>
-			</u-cell-item>
-			<u-field label="计量单位" placeholder="请输入计量单位" label-width="180" v-model="goodInfo.unit" :disabled="ifEdit()"></u-field>
-			<u-cell-item title="库存" :arrow="false">
-				<u-number-box :min="1" v-model="goodInfo.stock" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box>
-			</u-cell-item>
-			<u-field label="商品说明" placeholder="请输入商品说明" label-width="180" v-model="goodInfo.productDescribe"
-			 :disabled="ifEdit()"></u-field>
-			<u-cell-item title="商品分类" :value="sortText" @click="selectShow = !ifEdit()"></u-cell-item>
-			<u-cell-item title="拍卖截止时间" :value="goodInfo.auctionEndTime" @click="dateShow = !ifEdit()" v-if="formType == 2"></u-cell-item>
-		</u-cell-group>
-		<view class="form-handle">
-			<u-button type="success" shape="circle" :ripple="true" @click="submitData" :disabled="getPermit()" class="handle-custom">{{type == 'add' ? '提交' : (type == 'detail' ? '编辑' : '保存')}}</u-button>
+			</u-form-item>
+			<u-form-item label="原价" prop="originalPrice" required>
+				<!-- <u-number-box :positive-integer="false" :min="0.01" step="1" v-model="goodInfo.originalPrice" bg-color="#51A539"
+				 color="#ffffff" :disabled="ifEdit()" digit></u-number-box> -->
+				<CnumberBox @getNum="getOriginalPrice" :isDisabled="ifEdit()" minNum="0.01" :isInt="false"></CnumberBox>
+			</u-form-item>
+			<u-form-item :label="formType == 1 ? '售价' : '采摘价格'" prop="bizPrice" required v-if="formType != 2">
+				<!-- <u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.bizPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()" digit></u-number-box> -->
+				<CnumberBox @getNum="getBizPrice" :isDisabled="ifEdit()" minNum="0.01" :isInt="false"></CnumberBox>
+			</u-form-item>
+			<u-form-item label="起拍价" prop="auctionStartPrice" required v-if="formType == 2">
+				<!-- <u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.auctionStartPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()" digit></u-number-box> -->
+				<CnumberBox @getNum="getStartPrice" :isDisabled="ifEdit()" minNum="0.01" :isInt="false"></CnumberBox>
+			</u-form-item>
+			<u-form-item label="每次最低加价金额" prop="auctionMinAddPrice" required v-if="formType == 2">
+				<!-- <u-number-box :positive-integer="false" :min="0.01" v-model="goodInfo.auctionMinAddPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()" digit></u-number-box> -->
+				<CnumberBox @getNum="getAddPrice" :isDisabled="ifEdit()" minNum="0.01" :isInt="false"></CnumberBox>
+			</u-form-item>
+			<u-form-item label="计量单位" prop="unit" required>
+				<u-input v-model="goodInfo.unit" type="text" placeholder="请输入计量单位" :disabled="ifEdit()"/>
+			</u-form-item>
+			<u-form-item label="库存" prop="stock" required>
+				<!-- <u-number-box :min="1" v-model="goodInfo.stock" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box> -->
+				<CnumberBox @getNum="getStockNum" :isDisabled="ifEdit()" minNum="1"></CnumberBox>
+			</u-form-item>
+			<u-form-item label="商品说明" prop="productDescribe" required>
+				<u-input v-model="goodInfo.productDescribe" type="text" placeholder="请输入商品说明" :disabled="ifEdit()"/>
+			</u-form-item>
+			<u-form-item label="商品分类" right-icon="arrow-right" required @click.native="selectShow = !ifEdit()">
+				<text>{{sortText}}</text>
+			</u-form-item>
+			<u-form-item label="拍卖截止时间" right-icon="arrow-right" required @click.native="dateShow = !ifEdit()" v-if="formType == 2">
+				<text>{{goodInfo.auctionEndTime}}</text>
+			</u-form-item>
+		</u-form>
+		<view class="handle-fix-box">
+			<u-button type="success" shape="circle" :ripple="true" :custom-style="customStyle" @click="submitData" :disabled="getPermit()">{{type == 'add' ? '提交' : (type == 'detail' ? '编辑' : '保存')}}</u-button>
 		</view>
 		<u-picker mode="time" v-model="dateShow" :start-year="startYear" :params="params" @confirm="setDate"></u-picker>
 		<u-select v-model="selectShow" mode="mutil-column-auto" :list="sortList" @confirm="setSort"></u-select>
@@ -48,7 +62,11 @@
 <script>
 	const NET = require('@/utils/request')
 	const API = require('@/config/api')
+	import CnumberBox from '@/components/CnumberBox.vue'
 	export default {
+		components: {
+			CnumberBox
+		},
 		data() {
 			return {
 				goodId: '',
@@ -86,7 +104,11 @@
 				uploadUrl: '',
 				fileList: [],
 				defaultList: [],
-				keyboardShow: false
+				keyboardShow: false,
+				customStyle: { //  底部悬浮按钮样式
+					height: '40px',
+					backgroundColor: '#56a83a'
+				}
 			}
 		},
 		onLoad(options) {
@@ -155,6 +177,26 @@
 			}
 		},
 		methods: {
+			// 获取子组件原价
+			getOriginalPrice(num) {
+				this.goodInfo.originalPrice = num
+			},
+			// 获取售价或采摘价
+			getBizPrice(num) {
+				this.goodInfo.bizPrice = num
+			},
+			// 起拍价
+			getStartPrice(num) {
+				this.goodInfo.auctionStartPrice = num
+			},
+			// 获取拍卖加价额
+			getAddPrice(num) {
+				this.goodInfo.auctionMinAddPrice = num
+			},
+			// 获取子组件的库存数量
+			getStockNum(num) {
+				this.goodInfo.stock = num
+			},
 			//  校验当前模式
 			ifEdit() {
 				return this.type == 'add' || this.type == 'edit' ? false : true
@@ -275,54 +317,28 @@
 	}
 </script>
 
-<style lang="less" scoped>
+<style>
 	page {
 		width: 100%;
 		height: 100%;
 	}
-
+</style>
+<style lang="less" scoped>
 	.container {
 		width: 100%;
-		height: 100%;
 		float: left;
-		overflow-y: auto;
+		padding: 0 15px 60px 15px;
 
-		.form-info {
+		.handle-fix-box {
 			width: 100%;
-			float: left;
-
-			/deep/.u-label-text {
-				color: #333333;
-			}
-
-			/deep/.u-cell_title {
-				color: #333333;
-			}
-
-			.good-img {
-				float: left;
-				margin: 5px;
-			}
-		}
-
-		.form-handle {
-			width: calc(100% - 30px);
-			float: left;
-			height: 40px;
-			margin: 30px 15px 20px 15px;
-
-
-			.handle-custom {
-				background-color: #51A539;
-
-				/deep/button {
-					background-color: #56a83a;
-				}
-
-				/deep/.u-btn--success--disabled {
-					background-color: #74bd60 !important;
-				}
-			}
+			box-sizing: border-box;
+			padding: 10px 15px;
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			height: 60px;
+			background-color: #FFFFFF;
+			z-index: 999;
 		}
 	}
 </style>

+ 17 - 1
pagesMain/bindOrder.vue

@@ -1,7 +1,9 @@
 <template>
 	<view class="container">
 		<u-cell-group :border="false">
-			<u-field label="快递单号" placeholder="请输入快递单号" v-model="logisticsNum"></u-field>
+			<u-field label="快递单号" placeholder="请输入快递单号(仅限顺丰)" v-model="logisticsNum">
+				<u-icon name="scan" slot="right" color="#52A63A" size="35" @click="scan"></u-icon>
+			</u-field>
 		</u-cell-group>
 		<view class="form-handle">
 			<u-button type="success" shape="circle" :ripple="true" @click="submitData" class="handle-custom" :disabled="!logisticsNum">绑定</u-button>
@@ -24,6 +26,20 @@
 			this.orderId = options.orderId
 		},
 		methods: {
+			// 调起扫码
+			scan() {
+				let that = this;
+				// 调起条码扫描
+				uni.scanCode({
+				    scanType: 'barCode',
+				    success: function (res) {
+						console.log(res)
+					    that.logisticsNum = res.result;
+					    console.log('条码类型:' + res.scanType);
+					    console.log('条码内容:' + res.result);
+				    }
+				});
+			},
 			//  提交数据
 			submitData() {
 				NET.request(API.bindOrder, {

+ 321 - 78
pagesMain/orderDetail.vue

@@ -36,14 +36,17 @@
 							<text class="goods-number">x{{item.buyNum}}</text>
 							<text class="plant-text" v-if="item.productType == 4">有效期:{{item.term}}天</text>
 						</view>
+						<view class="goods-editnumber">
+							<CnumberBox v-if="item.productType == 3 && isEdit" isDisabled @getNum="getStockNum($event,index)" minNum="1"></CnumberBox>
+						</view>
 					</view>
 				</view>
 			</view>
 			<view class="order-info">
 				<u-cell-group :border="false">
 					<u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
-					<u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
-					<u-cell-item title="优惠券" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
+					<u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
+					<u-cell-item title="优惠券" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
 					<u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
 				</u-cell-group>
 			</view>
@@ -90,7 +93,7 @@
 			</view>
 			<view class="info-content-box">
 				<view class="assess-row">
-					<image class="assess-head" :src="orderData.merchantInfoResVO.headImg"></image>
+					<image class="assess-head" mode="aspectFill" :src="orderData.merchantInfoResVO.headImg"></image>
 					<view class="assess-info">
 						<view class="assess-name">{{orderData.nickname}}</view>
 						<view class="assess-date">{{orderData.evaluateResVO.evaluateTime ? orderData.evaluateResVO.evaluateTime : ''}}</view>
@@ -99,7 +102,7 @@
 						</view>
 						<view class="assess-text">{{orderData.evaluateResVO.evaluateContent ? orderData.evaluateResVO.evaluateContent : '暂无评价'}}</view>
 						<view class="assess-img-box">
-							<image class="img-col" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs" :key="i"></image>
+							<image class="img-col" mode="aspectFill" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs" :key="i" @tap="_previewImage(item.imgUrl,i)"></image>
 						</view>
 					</view>
 					<view class="shop-reply-box" v-if="orderData.evaluateResVO.replyContent">
@@ -113,17 +116,38 @@
 			</view>
 		</view>
 		<uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup"
-		 v-if="(orderData.orderStatus >= 2 && orderData.orderStatus <= 4) || (orderData.orderStatus == 5 && orderData.evaluateReplyStatus == 1)" />
+		 v-if="(orderData.orderStatus >= 1 && orderData.orderStatus <= 4) || (orderData.orderStatus == 5 && orderData.evaluateReplyStatus == 1)" />
 		<u-top-tips ref="uTips"></u-top-tips>
+		<view class="uni-popup-dialog" :hidden="show_qx">
+			<view class="uni-dialog-title">
+				<text class="uni-dialog-title-text">提示</text>
+			</view>
+			<view class="uni-dialog-content">
+				<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+			</view>
+			<view class="uni-dialog-button-group">
+				<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+					设置权限
+				</button>
+			</view>
+		
+		</view>
+		<view class="qx_bg" :hidden="show_qx">
+		</view>
 	</view>
 </template>
 
 <script>
 	const NET = require('@/utils/request')
 	const API = require('@/config/api')
+	import CnumberBox from '@/components/CnumberBox.vue'
 	export default {
+		components: {
+			CnumberBox
+		},
 		data() {
 			return {
+				show_qx:true,
 				orderType: {
 					title: '',
 					text: '',
@@ -153,12 +177,7 @@
 					tenantCode: '',
 					evaluateReplyStatus: 1,
 				},
-				goodType: 1,
-				// buttonGroup: [{
-				// 	text: '',
-				// 	backgroundColor: '#52A63A',
-				// 	color: '#fff'
-				// }],
+				goodType: 1, // 1是普通商品类型;2是包含自助采摘+普通商品的类型;3是拍卖、共享种植
 				buttonGroup: [
 				    {
 				    	text: '',
@@ -166,76 +185,115 @@
 				    	color: '#fff'
 				    }	
 				],
-				noPick: true // 没有自助采摘的商品
+				noPick: true, // 没有自助采摘的商品
+				isEdit: false,
+				orderId: '',
+				orderStatus: 1,
+				isClick: false
 			}
 		},
 		onLoad(options) {
 			this.userData = uni.getStorageSync("userData")
-			NET.request(API.getOrderDetail, {
-				flag: 2,
-				orderId: options.orderId,
-				orderStatus: options.orderStatus,
-			}, 'GET').then(res => {
-				this.orderData = res.data
-				if (this.orderData.addOrderTime) {
-					let tempTime = new Date(this.orderData.addOrderTime).getTime()
-					let addTempTime = new Date(tempTime + 1000 * 60 * 60 * 24)
-					let addYear = addTempTime.getFullYear()
-					let addMonth = addTempTime.getMonth() + 1
-					let addDay = addTempTime.getDate()
-					let addHours = addTempTime.getHours()
-					let addMin = addTempTime.getMinutes()
-					let addSeconds = addTempTime.getSeconds()
-					this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' +
-						addSeconds
-				}
-				if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
-					2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
-					this.goodType = 1
-				} else {
-					this.goodType = 2
-				}
-				if (this.orderData.orderStatus == 2) {
-					if (this.orderData.merchantInfoResVO.products.length) {
+			this.orderId = options.orderId
+			this.orderStatus = options.orderStatus
+			this.getDetail()
+		},
+		onShow() {},
+		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
+			// 获取订单详情
+			getDetail() {
+				NET.request(API.getOrderDetail, {
+					flag: 2,
+					orderId: this.orderId,
+					orderStatus: this.orderStatus,
+				}, 'GET').then(res => {
+					this.orderData = res.data
+					if (this.orderData.addOrderTime) {
+						let tempTime = new Date(this.orderData.addOrderTime).getTime()
+						let addTempTime = new Date(tempTime + 1000 * 60 * 60 * 24)
+						let addYear = addTempTime.getFullYear()
+						let addMonth = addTempTime.getMonth() + 1
+						let addDay = addTempTime.getDate()
+						let addHours = addTempTime.getHours()
+						let addMin = addTempTime.getMinutes()
+						let addSeconds = addTempTime.getSeconds()
+						this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' +
+							addSeconds
+					}
+					if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
+						2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
+						// this.goodType = 1
 						if (this.orderData.merchantInfoResVO.products.some(v => {return v.productType == 3})) {
-						    this.noPick = false
-							this.buttonGroup = [{
-								text: '发货',
-								backgroundColor: '#75BD60',
-								color: '#fff'
-							}, {
-								text: '自助采摘',
-								backgroundColor: '#52A63A',
-								color: '#fff'
-							}]
+							this.goodType = 3
 						} else {
-							this.buttonGroup = [{
-								text: '发货',
-								backgroundColor: '#75BD60',
-								color: '#fff'
-							}]
+							this.goodType = 1
 						}
+					} else {
+						this.goodType = 2
 					}
-					if (this.orderData.auctionStatus == 1) {
+					if (this.orderData.orderStatus == 1 && this.goodType == 3) {
+						this.buttonGroup = [{
+							text: '修改订单',
+							backgroundColor: '#75BD60',
+							color: '#fff'
+						}]
+					} else if (this.orderData.orderStatus == 2) {
+						if (this.orderData.merchantInfoResVO.products.length) {
+							if (this.orderData.merchantInfoResVO.products.some(v => {return v.productType == 3})) {
+							    this.noPick = false
+								this.buttonGroup = [{
+									text: '发货',
+									backgroundColor: '#75BD60',
+									color: '#fff'
+								}, {
+									text: '自助采摘',
+									backgroundColor: '#52A63A',
+									color: '#fff'
+								}]
+							} else {
+								this.buttonGroup = [{
+									text: '发货',
+									backgroundColor: '#75BD60',
+									color: '#fff'
+								}]
+							}
+						}
+						if (this.orderData.auctionStatus == 1) {
+							this.buttonGroup = []
+						}
+					} else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
+						this.buttonGroup[0].text = '追踪物流'
+					} else if (this.orderData.evaluateReplyStatus == 1) {
+						this.buttonGroup[0].text = '回复'
+					} else {
 						this.buttonGroup = []
 					}
-				} else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
-					this.buttonGroup[0].text = '追踪物流'
-				} else if (this.orderData.evaluateReplyStatus == 1) {
-					this.buttonGroup[0].text = '回复'
-				} else {
-					this.buttonGroup = []
-				}
-				this.getOrderType()
-			}).catch(error => {
-				this.$refs.uTips.show({
-					title: error.data.msg,
-					type: 'warning',
+					this.getOrderType()
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.data.msg,
+						type: 'warning',
+					})
 				})
-			})
-		},
-		onShow() {},
-		methods: {
+			},
+			// 获取子组件的库存数量/
+			getStockNum(num,index) {
+				this.isClick = true
+				debugger
+				this.orderData.merchantInfoResVO.products[index].buyNum = num
+				this.getEditSum()
+			},
+			// 计算实付额和订单总额
+			getEditSum() {
+				let price = this.orderData.merchantInfoResVO.products.reduce((total, site) => {
+					return total + site.bizPrice * site.buyNum
+				}, 0)
+				this.orderData.orderSum = price.toFixed(2)
+				this.orderData.paySum = (price - this.orderData.discountAmount).toFixed(2)
+			},
 			//  获取订单类型
 			getOrderType() {
 				switch (this.orderData.orderStatus) {
@@ -278,7 +336,41 @@
 			},
 			//  操作
 			orderHandle(e) {
-				if (this.orderData.orderStatus == 2) {
+				if (this.orderData.orderStatus == 1) {
+					this.buttonGroup = [{
+						text: this.isEdit ? '修改订单' : '提交订单',
+						backgroundColor: this.isEdit ? '#52A63A' : '#75BD60',
+						color: '#fff'
+					}]
+					if (this.isEdit) {
+						if (!this.isClick) {
+							this.orderData.merchantInfoResVO.products.forEach(v => {
+								if (v.productType == 3) {
+									v.buyNum = 1
+								}
+							})
+							this.getEditSum()
+						}
+						NET.request(API.editOrder, {
+							orderId: this.orderData.orderId,
+							orderSum: this.orderData.orderSum,
+							paySum: this.orderData.paySum,
+							products: this.orderData.merchantInfoResVO.products
+						}, 'POST').then(res => {
+							this.$refs.uTips.show({
+								title: '修改成功',
+								type: 'success',
+							})
+							this.getDetail()
+						}).catch(error => {
+							this.$refs.uTips.show({
+								title: error.data.msg,
+								type: 'warning',
+							})
+						})
+					}
+					this.isEdit = !this.isEdit
+				} else if (this.orderData.orderStatus == 2) {
 					if (e.index == 0) {
 						//  发货
 						uni.navigateTo({
@@ -286,9 +378,32 @@
 						});
 					} else if (e.index == 1) {
 						//  去自助采摘
-						uni.navigateTo({
-							url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
-						});
+						var that=this;
+						if(uni.getStorageSync("firstTimeLive")==""){
+							uni.setStorage({
+								key: 'firstTimeLive',
+								data: 1
+							})
+							uni.navigateTo({
+								url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+							});
+						}else{
+							wx.getSetting({
+							  success(res) {
+								if (!res.authSetting['scope.camera']){
+								  that.show_qx=false;
+								}else if (!res.authSetting['scope.record']){
+								  that.show_qx=false;
+								}else{
+									uni.navigateTo({
+										url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+									});
+								}
+							  }
+							})
+						}
+						
+						
 					}
 				} else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
 					//  追踪物流
@@ -307,7 +422,17 @@
 				uni.navigateTo({
 					url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
 				});
-			}
+			},
+			// 图片预览
+			_previewImage(image,index) {
+				var imgArr = [];
+				imgArr.push(image);
+				//预览图片
+				uni.previewImage({
+					urls: imgArr,
+					current: imgArr[index]
+				});
+			} 
 		}
 	}
 </script>
@@ -469,7 +594,7 @@
 
 				.goods-row {
 					width: 100%;
-					height: 90px;
+					height: 110px;
 					float: left;
 					display: flex;
 					margin-bottom: 10px;
@@ -525,10 +650,10 @@
 						}
 
 						.goods-price-number {
-							width: 100%;
+							width: 60%;
 							height: 20px;
 							float: left;
-							line-height: 20px;
+							line-height: 40px;
 							font-family: PingFang SC;
 							color: #333333;
 
@@ -545,6 +670,11 @@
 								font-size: 12px;
 							}
 						}
+                        
+						.goods-editnumber {
+							float: left;
+							width: 35%
+						}
 
 						.plant-text {
 							float: right;
@@ -853,4 +983,117 @@
 			border-top: 1px solid #cccccc;
 		}
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 11;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 10;
+	}
+	/deep/.uni-tab__cart-button-right{
+		border-right: 1px solid #ffffff;
+	}
+	/deep/.uni-tab__cart-button-right:last-child{
+		border-right: none;
+	}
 </style>

+ 179 - 7
pagesMain/orderItem.vue

@@ -1,4 +1,5 @@
 <template>
+	<view class="container">
 	<view class="order-row" @click="goToOrderDetail()">
 		<view class="shop-info" v-if="orderData">
 			<text class="iconfont iconwode"></text>
@@ -34,6 +35,23 @@
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
+	<view class="uni-popup-dialog" :hidden="show_qx">
+		<view class="uni-dialog-title">
+			<text class="uni-dialog-title-text">提示</text>
+		</view>
+		<view class="uni-dialog-content">
+			<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+		</view>
+		<view class="uni-dialog-button-group">
+			<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+				设置权限
+			</button>
+		</view>
+	
+	</view>
+	<view class="qx_bg" :hidden="show_qx">
+	</view>
+	</view>
 </template>
 
 <script>
@@ -75,10 +93,15 @@
 			},
 		},
 		data() {
-			return {}
+			return {
+				show_qx:true
+			}
 		},
 		onLoad() {},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  获取订单总价
 			getAllPrice() {
 				let price = this.orderData.products.reduce((total, site) => {
@@ -141,9 +164,30 @@
 					});
 				} else if (type == 6) {
 					// 自助采摘
-					uni.navigateTo({
-						url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
-					});
+					var that=this;
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+						});
+					}else{
+						wx.getSetting({
+						  success(res) {
+							if (!res.authSetting['scope.camera']){
+							  that.show_qx=false;
+							}else if (!res.authSetting['scope.record']){
+							  that.show_qx=false;
+							}else{
+								uni.navigateTo({
+									url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+								});
+							}
+						  }
+						})
+					}
 				}
 			},
 			//  跳转订单详情
@@ -154,9 +198,30 @@
 					});
 				} else {
 					//  自助采摘
-					uni.navigateTo({
-						url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
-					});
+					var that=this;
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+						});
+					}else{
+						wx.getSetting({
+						  success(res) {
+							if (!res.authSetting['scope.camera']){
+							  that.show_qx=false;
+							}else if (!res.authSetting['scope.record']){
+							  that.show_qx=false;
+							}else{
+								uni.navigateTo({
+									url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+								});
+							}
+						  }
+						})
+					}
 				}
 			},
 		}
@@ -325,4 +390,111 @@
 			}
 		}
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 11;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 10;
+	}
 </style>

+ 240 - 8
pagesMedia/liveDetail.vue

@@ -4,7 +4,7 @@
 		<view class="top_box" :style="{ top: btn_top, left: btn_left}">
 			<image class="top_box_img" :src="head_img"></image>
 			<view class="top_box_text">
-				<text class="text_box_top">{{title}}</text><text class="text_box_bottom" style="display:none">{{user_name}}</text>
+				<text class="text_box_top">{{title}}</text><text class="text_box_bottom" >{{user_name}}</text>
 			</view>
 		</view>
 		<view class="popup-flip" @click="changeCamera()">
@@ -38,6 +38,22 @@
 			</view>
 		</u-popup>
 		<u-top-tips ref="uTips"></u-top-tips>
+		
+		
+		<view class="talk_box" :style="{ left: btn_left}">
+			<view class="line_box" v-for="(item, index) in text_list" :key="index">
+			  <view class="talk_box_timp" >
+				<image :src="item.description"></image>
+				<text>{{item.extension}}:{{item.data}}</text>
+			  </view>
+			</view>
+		  </view>
+		  <view class="talk_input" :style="{ left: btn_left}">
+			<view class="talk_box_timp" style="width: 60%;height: 80rpx;padding: 10rpx;">
+			  <input placeholder="说点什么..." placeholder-style="color:#fff" :value="send_value" type='text' confirm-type="send" @confirm="sendsms_fun" @input="getVal"/>
+			 
+			</view>
+	    </view>
 	</view>
 </template>
 
@@ -55,6 +71,12 @@
 		},
 		data() {
 			return {
+				text_list:[
+				 //{description:'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJc8RKCs43SAHMkh1bxVR3WTCr0MRkPCQkhlPrhA6Zhib1l5BouSIW0g6su8ia1cNVKhC2IZmM5humA/132',extension:'1111',data:'323123'}
+				],
+				first_gx:true,
+				send_value:'',
+				roomID: '',
 				liveId: '',
 				popupShow: false,
 				goodList: [],
@@ -100,6 +122,13 @@
 					type: 'warning',
 				})
 			})
+			NET.request(API.startLivePushMessage + options.liveId, {}, 'GET').then(res => {
+				
+			//this.goodsList = res.data
+			}).catch(res => {
+				
+			})
+			
 		},
 		onReady() {
 			var that=this;
@@ -109,7 +138,7 @@
 			 wx.getSystemInfo({
 			    success: res => {
 					this.setData({
-						btn_left: res.windowWidth - menuButtonObject.right+'rpx',
+						btn_left: res.windowWidth - menuButtonObject.right+'px',
 						btn_top:menuButtonObject.top+menuButtonObject.height+14+'rpx'
 					})
 				},
@@ -130,7 +159,8 @@
 				});
 				this.setData({
 					head_img:res.data.imgUrl,
-					title:res.data.liveName
+					title:res.data.liveName,
+					roomID:Number(res.data.roomId)
 				})
 			}).catch(res => {
 				this.$refs.uTips.show({
@@ -151,6 +181,52 @@
 			})
 		},
 		methods: {
+			getVal(e) {
+				let {
+					value
+				} = e.detail
+				this.send_value = value;
+			},
+			sendsms_fun:function(){
+				/*this.trtcComponent.sendGroupTextMessage({
+				  roomID: Number(this.data.roomID), // 房间 ID
+				  message: this.data.title,
+				})*/
+				if(Number(wx.getStorageSync('jy_time'))>(new Date()).valueOf()){
+				  wx.showToast({
+					  title: "禁言中,不能发言",
+					  icon: 'none'
+				  })
+				  return false;
+				}
+				
+				this.trtcComponent.sendGroupCustomMessage({
+				  roomID: Number(this.roomID), // 房间 ID
+				  payload: {
+					data: this.send_value,
+					description: uni.getStorageSync("userData").headImage,
+					extension: uni.getStorageSync("userData").userName
+				  }
+				})
+				var that=this;
+				console.log("new_log",uni.getStorageSync("userData"))
+				var temp={
+				  data: this.send_value,
+				  description: uni.getStorageSync("userData").headImage,
+				  extension: uni.getStorageSync("userData").userName
+				};
+				var data=that.text_list;
+				if(data.length==5){
+				  data.shift();
+				}
+				data.push(temp);
+				this.setData({
+				  text_list:data,
+				});
+				this.setData({
+				  send_value:'',
+				});
+			},
 			//  勾选商品
 			checkGoods(site) {
 				site.check = !site.check
@@ -179,12 +255,12 @@
 				}, 'POST').then(res => {
 					this.popupShow = false
 					this.$refs.uTips.show({
-						title: '绑定商品成功',
+						title: '设置成功',
 						type: 'success',
 					})
 				}).catch(res => {
 					this.$refs.uTips.show({
-						title: '绑定商品失败',
+						title: '设置失败',
 						type: 'warning',
 					})
 				})
@@ -221,7 +297,14 @@
 					scene: "live",
 					maxBitrate: 2000,
 					minBitrate: 1500,
-					beautyLevel: 9 // 默认开启美颜
+					beautyLevel: 9, // 默认开启美颜
+					enableIM: true, // 用于组件内渲染
+					showIMPanel: false,
+					exitIMThrottle: false,
+					messageContent: '',
+					messageList: [], // 仅保留10条消息
+					maxMessageListLength: 10,
+					messageListScrollTop: 0
 				};
 				this.setData({
 					rtcConfig: this.rtcConfig
@@ -245,6 +328,18 @@
 					});
 				});
 			},
+			setNum:function(){
+				var that=this;
+				let promise = that.trtcComponent.tim.getGroupProfile({ groupID: this.roomID+"" });
+				promise.then(function(imResponse) {
+					that.setData({
+						user_name:(Number(imResponse.data.group.memberCount)-1)
+					})
+				  console.log(imResponse.data.group);
+				}).catch(function(imError) {
+				  console.warn('getGroupProfile error:', imError); // 获取群详细资料失败的相关信息
+				});
+			},
 			bindTRTCRoomEvent: function() {
 				const TRTC_EVENT = this.trtcComponent.EVENT;
 				this.timestamp = []; // 初始化事件订阅
@@ -363,6 +458,69 @@
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_AUDIO_REMOVE, event => {
 					console.log('* room REMOTE_AUDIO_REMOVE', event, this.trtcComponent.getRemoteUserList());
 				});
+				this.trtcComponent.on(TRTC_EVENT.IM_READY, event => {
+				  console.log('* room IM_READY', event)
+				  var that=this;
+				  if(event.data.name=="onMessageReceived"){
+					  setTimeout(function(){
+						  if(that.first_gx){
+							  that.first_gx=false;
+							  that.setNum();
+						  }
+					  },3000)
+				  }
+				})
+				this.trtcComponent.on(TRTC_EVENT.IM_MESSAGE_RECEIVED, event => {
+				  var that=this;
+				  if(event.data.data==undefined){
+					  return false;
+				  }
+				  if(event.data.data[0]==undefined){
+					  return false;
+				  }
+				  
+				  if(event.data.data[0].type=="TIMCustomElem"){
+					if(event.data.data[0].payload.description==0||event.data.data[0].payload.description==1||event.data.data[0].payload.description==2||event.data.data[0].payload.description==3){
+					  var user_id=wx.getStorageSync('uid');
+					  if(event.data.data[0].payload.data==user_id){
+						var jy_time=0;
+						if(event.data.data[0].payload.description==0){
+						  jy_time=(new Date()).valueOf()+5*60*1000;
+						}
+						if(event.data.data[0].payload.description==1){
+						  jy_time=(new Date()).valueOf()+10*60*1000;
+						}
+						if(event.data.data[0].payload.description==2){
+						  jy_time=(new Date()).valueOf()+30*60*1000;
+						}
+						if(event.data.data[0].payload.description==3){
+						  jy_time=(new Date()).valueOf()+60*60*1000;
+						}
+						wx.setStorageSync('jy_time', jy_time)
+					  }
+					  wx.showToast({
+						  title: event.data.data[0].payload.extension,
+						  icon: 'none'
+					  })
+					}else{
+					  var temp=event.data.data[0].payload;
+					  if(temp.data=="genxin"){
+						  setTimeout(function(){
+							  that.setNum();
+						  },3000)
+						  return false;
+					  }
+					  var data=that.text_list;
+					  if(data.length==5){
+						data.shift();
+					  }
+					  data.push(temp);
+					  this.setData({
+						text_list:data,
+					  });
+					}
+				  }
+				})
 			},
 			changeCamera: function() {
 				this.trtcComponent.switchCamera();
@@ -571,17 +729,91 @@
 		  padding-top: 2rpx;
 		}
 		.text_box_top{
-		 font-size: 34rpx;
+		  font-size: 28rpx;
 		 width: 100%;
 		 display: block;
 		 height: 30rpx;
 		 float: left;
-		 margin-top: 19rpx;
+		 margin-top: 6rpx;
 		}
 		.text_box_bottom{
 		  font-size: 22rpx;
 		  float: left;
 		  margin-top: 10rpx;
 		}
+		.tx_btn{
+			background: #4fa237;
+			display: inline-block;
+			height: 70rpx;
+			margin-top: 5rpx;
+			border-radius: 60rpx;
+			line-height: 70rpx;
+			padding: 0 30rpx;
+			margin-left: 30rpx;
+		}
+		.tx_btn image{
+			width: 60rpx;
+			height: 60rpx;
+			margin-top: 5rpx;
+			margin-right: 20rpx;
+		}
+		.tixingn{
+			font-size: 34rpx;
+			display: flex;
+		}
+		    
+		.tixingn:before {
+		  font-size: 60rpx;
+		}
+		.talk_box{
+		  z-index: 10;
+		position: absolute;
+		bottom: 30rpx;
+		left: 0rpx;
+		}
+		.line_box{
+		  width:100%
+		}
+		.talk_box_timp{
+		  display: inline-block;
+		border-radius: 60rpx;
+		background: rgba(0, 0, 0, 0.4);
+		margin-bottom: 10rpx;
+		}
+		.talk_box_timp image{
+		  width: 56rpx;
+		height: 56rpx;
+		border-radius: 60rpx;
+		float: left;
+		
+		}
+		.talk_box_timp text{
+		  float: left;
+		color: #fff;
+		padding-top: 6rpx;
+		padding-right: 50rpx;
+		font-size: 28rpx;
+		margin-left: 20rpx;
+		line-height: 45rpx;
+		}
+		.talk_input{
+			display:none;
+		  z-index: 10;
+		position: absolute;
+		bottom: 38rpx;
+		left: 0rpx;
+		width:100%
+		}
+		.talk_box_timp input{
+		  float: left;
+		  color: #fff;
+		  padding-top: 6rpx;
+		  padding-right: 50rpx;
+		  font-size: 30rpx;
+		  margin-left: 20rpx;
+		  line-height: 45rpx;
+		  line-height: 34rpx;  
+		}
+		
 	}
 </style>

+ 29 - 21
pagesMedia/liveOption.vue

@@ -11,10 +11,10 @@
 			<u-cell-item title="直播起始时间" :value="videoInfo.liveStartTime" @click="dateShow1 = true"></u-cell-item>
 			<u-cell-item title="直播结束时间" :value="videoInfo.liveEndTime" @click="dateShow2 = true"></u-cell-item>
 			<u-cell-item title="日期选择(可多选)" :arrow="false">
-				<view slot="label">
-					<u-checkbox-group>
-						<u-checkbox v-model="item.checked" v-for="(item, index) in checkList" :key="index" :name="item.value" shape="circle"
-						 active-color="#51A539">{{item.name}}</u-checkbox>
+				<view slot="label" @click.stop="">
+					<u-checkbox-group @click.stop="">
+						<u-checkbox size="40" v-model="item.checked" v-for="(item, index) in checkList" :key="index" :name="item.value" shape="circle"
+						 active-color="#51A539" @click.stop="">{{item.name}}</u-checkbox>
 					</u-checkbox-group>
 				</view>
 			</u-cell-item>
@@ -22,8 +22,8 @@
 		<view class="form-handle">
 			<u-button type="success" shape="circle" :ripple="true" @click="submitData" :disabled="getPermit()" class="handle-custom">提交</u-button>
 		</view>
-		<u-picker mode="time" v-model="dateShow1" :start-year="startYear" :params="params" @confirm="setDate1"></u-picker>
-		<u-picker mode="time" v-model="dateShow2" :start-year="startYear" :params="params" @confirm="setDate2"></u-picker>
+		<u-picker mode="time" v-model="dateShow1" :start-year="startYear" :params="params1" @confirm="setDate1"></u-picker>
+		<u-picker mode="time" v-model="dateShow2" :start-year="startYear" :params="params2" @confirm="setDate2"></u-picker>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
 </template>
@@ -43,52 +43,57 @@
 				checkList: [{
 						name: '星期一',
 						value: '1',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期二',
 						value: '2',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期三',
 						value: '3',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期四',
 						value: '4',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期五',
 						value: '5',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期六',
 						value: '6',
-						checked: false,
+						checked: true,
 						disabled: false
 					},
 					{
 						name: '星期天',
 						value: '7',
-						checked: false,
+						checked: true,
 						disabled: false
 					}
 				],
 				dateShow1: false,
 				dateShow2: false,
-				params: {
-					year: true,
-					month: true,
-					day: true,
+				params1: {
+					// year: true,
+					// month: true,
+					// day: true,
+					hour: true,
+					minute: true,
+					second: true
+				},
+				params2: {
 					hour: true,
 					minute: true,
 					second: true
@@ -164,13 +169,16 @@
 			},
 			//  设置时间
 			setDate1(data) {
-				this.videoInfo.liveStartTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute +
-					':' + data.second
+				// this.videoInfo.liveStartTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute +
+				// 	':' + data.second
+				this.videoInfo.liveStartTime = data.hour + ':' + data.minute + ':' + data.second
 			},
 			//  设置时间
 			setDate2(data) {
-				this.videoInfo.liveEndTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute +
-					':' + data.second
+				// this.videoInfo.liveEndTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute +
+				// 	':' + data.second
+				console.log('时间:', data)
+				this.videoInfo.liveEndTime = data.hour + ':' + data.minute + ':' + data.second
 			},
 			//  检查必填项
 			getPermit() {

+ 23 - 1
pagesMedia/pickVideo.vue

@@ -8,6 +8,9 @@
 		<view class="popup-open" @click="showGoods()">
 			<view class="iconfont iconzhibo-shangpin"></view>
 		</view>
+		<view class="popup-flip" @click="changeCamera()">
+			<view class="iconfont iconFill"></view>
+		</view>
 		<uni-popup ref="popup" type="bottom">
 			<view class="popup-box">
 				<view class="popup-close" @click="closeGoods()">收起</view>
@@ -110,6 +113,9 @@
 			})
 		},
 		methods: {
+			changeCamera: function() {
+				this.trtcComponent.switchCamera();
+			},
 			//  打开弹窗
 			showGoods() {
 				this.$refs.popup.open()
@@ -306,7 +312,23 @@
 		height: 100%;
 		float: left;
 		position: relative;
-
+		.popup-flip {
+			width: 50px;
+			height: 50px;
+			position: fixed;
+			top: 15px;
+			right: 15px;
+			background: #52A63A;
+			border-radius: 50%;
+			text-align: center;
+			line-height: 50px;
+			z-index: 10000;
+		
+			.iconFill {
+				color: #FFFFFF;
+				font-size: 34px;
+			}
+		}
 		.tip-toast {
 			position: absolute;
 			top: 40vh;

File diff suppressed because it is too large
+ 0 - 0
pagesMedia/trtc-room/common/tim-wx.js


+ 353 - 2
pagesMedia/trtc-room/trtc-room.vue

@@ -479,9 +479,11 @@ import { setData } from '@/pagesMedia/debug/GenerateTestUserSig';
 import UserController from './controller/user-controller';
 import Pusher from './model/pusher';
 import { EVENT } from './common/constants';
+import TIM from './common/tim-wx';
 import Event from './utils/event';
 import * as ENV from './utils/environment';
 const TAG_NAME = 'TRTC-ROOM';
+const IM_GROUP_TYPE = TIM.TYPES.GRP_CHATROOM // TIM.TYPES.GRP_CHATROOM 体验版IM无数量限制,成员20个, TIM.TYPES.GRP_AVCHATROOM IM体验版最多10个,升级后无限制
 
 export default {
 	data() {
@@ -505,7 +507,14 @@ export default {
 			remoteVolumeList: [],
 			appVersion: ENV.APP_VERSION,
 			libVersion: ENV.LIB_VERSION,
-			debugMode: ''
+			debugMode: '',
+			enableIM: true, // 用于组件内渲染
+			showIMPanel: false,
+			exitIMThrottle: false,
+			messageContent: '',
+			messageList: [], // 仅保留10条消息
+			maxMessageListLength: 10,
+			messageListScrollTop: 0,
 		};
 	},
 
@@ -519,7 +528,14 @@ export default {
 				userID: '',
 				userSig: '',
 				template: '',
-				debugMode: ''
+				debugMode: '',
+				enableIM: true, // 用于组件内渲染
+				showIMPanel: false,
+				exitIMThrottle: false,
+				messageContent: '',
+				messageList: [], // 仅保留10条消息
+				maxMessageListLength: 10,
+				messageListScrollTop: 0
 			})
 		}
 	},
@@ -615,6 +631,10 @@ export default {
 				console.log(TAG_NAME, 'pusher', this.pusher); // 1. 补齐进房参数,校验必要参数是否齐全
 
 				console.log('进房......', params, this.config, this.pusher);
+				if (this.config.enableIM && this.config.sdkAppID) {
+					this._initIM(this.config,params.roomID)
+				 // this._loginIM({ ...this.config, roomID: params.roomID })
+				}
 				if (params) {
 					Object.assign(this.pusher, params);
 					Object.assign(this.config, params);
@@ -659,6 +679,7 @@ export default {
 				this.pusher.reset();
 				this.status.isPush = false;
 				const result = this.userController.reset();
+				this._exitIM();
 				this.setData(
 					{
 						pusher: this.pusher,
@@ -2303,6 +2324,336 @@ export default {
 					})
 					.catch(() => {});
 			}
+		},
+		//  ______  __       __        ______             __                                              __
+		//  |      \|  \     /  \      |      \           |  \                                            |  \
+		//   \$$$$$$| $$\   /  $$       \$$$$$$ _______  _| $$_     ______    ______   _______    ______  | $$
+		//    | $$  | $$$\ /  $$$        | $$  |       \|   $$ \   /      \  /      \ |       \  |      \ | $$
+		//    | $$  | $$$$\  $$$$        | $$  | $$$$$$$\\$$$$$$  |  $$$$$$\|  $$$$$$\| $$$$$$$\  \$$$$$$\| $$
+		//    | $$  | $$\$$ $$ $$        | $$  | $$  | $$ | $$ __ | $$    $$| $$   \$$| $$  | $$ /      $$| $$
+		//   _| $$_ | $$ \$$$| $$       _| $$_ | $$  | $$ | $$|  \| $$$$$$$$| $$      | $$  | $$|  $$$$$$$| $$
+		//  |   $$ \| $$  \$ | $$      |   $$ \| $$  | $$  \$$  $$ \$$     \| $$      | $$  | $$ \$$    $$| $$
+		//   \$$$$$$ \$$      \$$       \$$$$$$ \$$   \$$   \$$$$   \$$$$$$$ \$$       \$$   \$$  \$$$$$$$ \$$
+		getCountNum(params) {
+			let promise = this.tim.getGroupProfile({ groupID: this.config.roomID+"" });
+			promise.then(function(imResponse) {
+			  console.log(imResponse.data.group);
+			}).catch(function(imError) {
+			  console.warn('getGroupProfile error:', imError); // 获取群详细资料失败的相关信息
+			});
+		},
+		/**
+		 * 初始化 IM SDK
+		 * @param {Object} config sdkAppID
+		 */
+		sendGroupCustomMessage(params) {
+		      if (!this.tim) {
+		        console.warn(TAG_NAME, '未开启IM功能,该方法无法使用', params)
+		        return
+		      }
+		      console.log(TAG_NAME, 'sendGroupCustomMessage', params)
+		      const message = this.tim.createCustomMessage({
+		        to: params.roomID + '',
+		        conversationType: TIM.TYPES.CONV_GROUP,
+		        payload: params.payload,
+		      })
+		      const promise = this.tim.sendMessage(message)
+		      promise.then(function(imResponse) {
+		        // 发送成功
+		        console.log(TAG_NAME, 'sendMessage success', imResponse)
+		      }).catch(function(imError) {
+		        // 发送失败
+		        console.warn(TAG_NAME, 'sendMessage error:', imError)
+		      })
+		      return promise
+		},
+		_initIM(config,roomId) {
+		  if (!config.enableIM || !config.sdkAppID || this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_initIM', config)
+		  // 初始化 sdk 实例
+		  const tim = TIM.create({
+			SDKAppID: config.sdkAppID,
+		  })
+		  // 0 普通级别,日志量较多,接入时建议使用
+		  // 1 release级别,SDK 输出关键信息,生产环境时建议使用
+		  // 2 告警级别,SDK 只输出告警和错误级别的日志
+		  // 3 错误级别,SDK 只输出错误级别的日志
+		  // 4 无日志级别,SDK 将不打印任何日志
+		  if (config.debugMode) {
+			tim.setLogLevel(1)
+		  } else {
+			tim.setLogLevel(4)
+		  }
+		  // 取消监听
+		  tim.off(TIM.EVENT.SDK_READY, this._onIMReady)
+		  tim.off(TIM.EVENT.MESSAGE_RECEIVED, this._onIMMessageReceived)
+		  tim.off(TIM.EVENT.SDK_NOT_READY, this._onIMNotReady)
+		  tim.off(TIM.EVENT.KICKED_OUT, this._onIMKickedOut)
+		  tim.off(TIM.EVENT.ERROR, this._onIMError)
+		  // 监听事件
+		  tim.on(TIM.EVENT.SDK_READY, this._onIMReady, this)
+		  tim.on(TIM.EVENT.MESSAGE_RECEIVED, this._onIMMessageReceived, this)
+		  tim.on(TIM.EVENT.SDK_NOT_READY, this._onIMNotReady, this)
+		  tim.on(TIM.EVENT.KICKED_OUT, this._onIMKickedOut, this)
+		  tim.on(TIM.EVENT.ERROR, this._onIMError, this)
+		  this.tim = tim
+		  wx.tim = tim
+		  this._loginIM({ ...this.config, roomID: roomId })
+		},
+		_loginIM(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_loginIM', params)
+		  var that=this;
+		  setTimeout(function(){
+			  that.sendGroupCustomMessage({
+				roomID: Number(that.config.roomID), // 房间 ID
+				payload: {
+				data: 'genxin',
+				description: 'genxin',
+				extension: 'genxin'
+				}
+			  })
+		  },2000)
+		  return this.tim.login({
+			userID: params.userID,
+			userSig: params.userSig,
+		  })
+		},
+		_logoutIM() {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_logoutIM')
+		  return this.tim.logout()
+		},
+		_exitIM() {
+			this.sendGroupCustomMessage({
+			  roomID: Number(this.config.roomID), // 房间 ID
+			  payload: {
+				data: 'genxin',
+				description: 'genxin',
+				extension: 'genxin'
+			  }
+			})
+			var that=this;
+		    setTimeout(function(){
+				// 方法需要调用限制,否则重复解散群 退群会有warn
+				if (that.config.exitIMThrottle || !that.tim) {
+							return
+				}
+				that.config.exitIMThrottle = true
+				const userList = that.getRemoteUserList()
+				const roomID = that.config.roomID
+				const userID = that.config.userID
+				that._searchGroup({ roomID }).then((imResponse) => {
+							// 查询群资料,判断是否为群主
+							if (imResponse.data.group.ownerID === userID && userList.length === 0) {
+							  // 如果 userList 为 0 群主可以解散群,并登出IM
+							  that._dismissGroup({ roomID }).then(()=>{
+								that.config.exitIMThrottle = false
+								that._logoutIM()
+							  }).catch((imError) => {
+								that.config.exitIMThrottle = false
+								that._logoutIM()
+							  })
+							} else if (imResponse.data.group.ownerID === userID) {
+							  that.config.exitIMThrottle = false
+							  // 群主不能退群只能登出
+							  that._logoutIM()
+							} else {
+							  // 普通成员退群并登出IM
+							  that._quitGroup({ roomID }).then(()=>{
+								that.config.exitIMThrottle = false
+								that._logoutIM()
+							  }).catch((imError) => {
+								that.config.exitIMThrottle = false
+								that._logoutIM()
+							  })
+							}
+				}).catch((imError) => {
+							that.config.exitIMThrottle = false
+							// 查询异常直接登出
+							that._logoutIM()
+				})
+			},2000)
+		},
+		_searchGroup(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_searchGroup', params)
+		  const tim = this.tim
+		  const promise = tim.searchGroupByID(params.roomID + '')
+		  promise.then(function(imResponse) {
+			// const group = imResponse.data.group // 群组信息
+			console.log(TAG_NAME, '_searchGroup success', imResponse)
+		  }).catch(function(imError) {
+			console.warn(TAG_NAME, '_searchGroup fail,TIM 报错信息不影响后续逻辑,可以忽略', imError) // 搜素群组失败的相关信息
+		  })
+		  return promise
+		},
+		/**
+		 * 创建 AVchatroom
+		 * @param {*} params roomID
+		 * @returns {Promise}
+		 */
+		_createGroup(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_createGroup', params)
+		  const promise = this.tim.createGroup({
+			groupID: params.roomID + '',
+			name: params.roomID + '',
+			type: IM_GROUP_TYPE,
+		  })
+		  promise.then((imResponse) => { // 创建成功
+			console.log(TAG_NAME, '_createGroup success', imResponse.data.group) // 创建的群的资料
+		  }).catch((imError) => {
+			console.warn(TAG_NAME, '_createGroup error', imError) // 创建群组失败的相关信息
+		  })
+		  return promise
+		},
+		/**
+		 * 进入 AVchatroom
+		 * @param {*} params roomID
+		 * @returns {Promise}
+		 */
+		_joinGroup(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_joinGroup', params)
+		  const promise = this.tim.joinGroup({ groupID: params.roomID + '', type: IM_GROUP_TYPE })
+		  promise.then((imResponse) => {
+			switch (imResponse.data.status) {
+			  case TIM.TYPES.JOIN_STATUS_WAIT_APPROVAL: // 等待管理员同意
+				break
+			  case TIM.TYPES.JOIN_STATUS_SUCCESS: // 加群成功
+			  case TIM.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: // 已经在群中
+				// console.log(imResponse.data.group) // 加入的群组资料
+				// wx.showToast({
+				//   title: '进群成功',
+				// })
+				console.log(TAG_NAME, '_joinGroup success', imResponse)
+				break
+			  default:
+				break
+			}
+		  }).catch((imError) => {
+			console.warn(TAG_NAME, 'joinGroup error', imError) // 申请加群失败的相关信息
+		  })
+		  return promise
+		},
+		_quitGroup(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_quitGroup', params)
+		  const promise = this.tim.quitGroup(params.roomID + '')
+		  promise.then((imResponse) => {
+			console.log(TAG_NAME, '_quitGroup success', imResponse)
+		  }).catch((imError) => {
+			console.warn(TAG_NAME, 'quitGroup error', imError)
+		  })
+		  return promise
+		},
+		_dismissGroup(params) {
+		  if (!this.tim) {
+			return
+		  }
+		  console.log(TAG_NAME, '_dismissGroup', params)
+		  const promise = this.tim.dismissGroup(params.roomID + '')
+		  promise.then((imResponse) => {
+			console.log(TAG_NAME, '_dismissGroup success', imResponse)
+		  }).catch((imError) => {
+			console.warn(TAG_NAME, '_dismissGroup error', imError)
+		  })
+		  return promise
+		},
+		_onIMReady(event) {
+		  console.log(TAG_NAME, 'IM.READY', event)
+		  this._emitter.emit(EVENT.IM_READY, event)
+		  const roomID = this.config.roomID
+		  // 查询群组是否存在
+		  this._searchGroup({ roomID }).then((res) => {
+			// console.log(TAG_NAME, 'searchGroup', res)
+			// 存在直接进群
+			this._joinGroup({ roomID })
+		  }).catch(() => {
+			// 不存在则创建,如果是avchatroom 创建后进群
+			this._createGroup({ roomID }).then((res) => {
+			  // 进群
+			  this._joinGroup({ roomID })
+			}).catch((imError)=> {
+			  if (imError.code === 10021) {
+				console.log(TAG_NAME, '群已存在,直接进群', event)
+				this._joinGroup({ roomID })
+			  }
+			})
+		  })
+		  // 收到离线消息和会话列表同步完毕通知,接入侧可以调用 sendMessage 等需要鉴权的接口
+		  // event.name - TIM.EVENT.IM_READY
+		},
+		_onIMMessageReceived(event) {
+		  // 收到推送的单聊、群聊、群提示、群系统通知的新消息,可通过遍历 event.data 获取消息列表数据并渲染到页面
+		  console.log(TAG_NAME, 'IM.MESSAGE_RECEIVED', event)
+		  // messageList 仅保留10条消息
+		  const messageData = event.data
+		  const roomID = this.config.roomID + ''
+		  const userID = this.config.userID + ''
+		  for (let i = 0; i < messageData.length; i++) {
+			const message = messageData[i]
+			// console.log(TAG_NAME, 'IM.MESSAGE_RECEIVED', message, this.config, TIM.TYPES.MSG_TEXT)
+			if (message.to === roomID + '' || message.to === userID) {
+			  // 遍历messageData 获取当前room 或者当前user的消息
+			  console.log(TAG_NAME, 'IM.MESSAGE_RECEIVED', message, message.type, TIM.TYPES.MSG_TEXT)
+			  if (message.type === TIM.TYPES.MSG_TEXT) {
+				this._pushMessageList({
+				  name: message.from,
+				  message: message.payload.text,
+				})
+			  } else {
+				if (message.type === TIM.TYPES.MSG_GRP_SYS_NOTICE && message.payload.operationType === 2) {
+				  // 群系统通知
+				  this._pushMessageList({
+					name: '系统通知',
+					message: `欢迎 ${userID}`,
+				  })
+				}
+				// 其他消息暂不处理
+			  }
+			}
+		  }
+		  this._emitter.emit(EVENT.IM_MESSAGE_RECEIVED, event)
+		},
+		_onIMNotReady(event) {
+		  console.log(TAG_NAME, 'IM.NOT_READY', event)
+		  this._emitter.emit(EVENT.IM_NOT_READY, event)
+		  // 收到 SDK 进入 not ready 状态通知,此时 SDK 无法正常工作
+		  // event.name - TIM.EVENT.IM_NOT_READY
+		},
+		_onIMKickedOut(event) {
+		  console.log(TAG_NAME, 'IM.KICKED_OUT', event)
+		  this._emitter.emit(EVENT.IM_KICKED_OUT, event)
+		  // 收到被踢下线通知
+		  // event.name - TIM.EVENT.KICKED_OUT
+		  // event.data.type - 被踢下线的原因,例如 :
+		  //    - TIM.TYPES.KICKED_OUT_MULT_ACCOUNT 多实例登录被踢
+		  //    - TIM.TYPES.KICKED_OUT_MULT_DEVICE 多终端登录被踢
+		  //    - TIM.TYPES.KICKED_OUT_USERSIG_EXPIRED 签名过期被踢。使用前需要将SDK版本升级至v2.4.0或以上。
+		},
+		_onIMError(event) {
+		  console.log(TAG_NAME, 'IM.ERROR', event)
+		  this._emitter.emit(EVENT.IM_ERROR, event)
+		  // 收到 SDK 发生错误通知,可以获取错误码和错误信息
+		  // event.name - TIM.EVENT.ERROR
+		  // event.data.code - 错误码
+		  // event.data.message - 错误信息
 		}
 	}
 };

Some files were not shown because too many files changed in this diff