Переглянути джерело

Signed-off-by: liuboyan <632697560@qq.com>
11

liuboyan 4 роки тому
батько
коміт
2f3461a53d
3 змінених файлів з 26 додано та 20 видалено
  1. 11 4
      pagesGood/goodForm.vue
  2. 1 1
      pagesGood/goodItem.vue
  3. 14 15
      pagesMain/pickVideo.vue

+ 11 - 4
pagesGood/goodForm.vue

@@ -11,16 +11,20 @@
 				</view>
 			</u-cell-item>
 			<u-cell-item title="原价" :arrow="false">
-				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.originalPrice" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box>
+				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.originalPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()"></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" v-model="goodInfo.bizPrice" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box>
+				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.bizPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()"></u-number-box>
 			</u-cell-item>
 			<u-cell-item title="起拍价" :arrow="false" v-if="formType == 2">
-				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.auctionStartPrice" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box>
+				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.auctionStartPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()"></u-number-box>
 			</u-cell-item>
 			<u-cell-item title="每次最低加价金额" :arrow="false" v-if="formType == 2">
-				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.auctionMinAddPrice" bg-color="#51A539" color="#ffffff" :disabled="ifEdit()"></u-number-box>
+				<u-number-box :positive-integer="false" :min="0" v-model="goodInfo.auctionMinAddPrice" bg-color="#51A539" color="#ffffff"
+				 :disabled="ifEdit()"></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">
@@ -204,6 +208,9 @@
 			},
 			//  提交
 			submitData() {
+				if (this.formType == 2) {
+					this.goodInfo.bizPrice = this.goodInfo.auctionStartPrice
+				}
 				if (this.type == 'detail') {
 					this.type = 'edit'
 				} else if (this.type == 'edit') {

+ 1 - 1
pagesGood/goodItem.vue

@@ -9,7 +9,7 @@
 				<view class="good-type">{{goodData.productType == 1 ? '普通商品' : (goodData.productType == 2 ? '拍卖商品' : '自主采摘')}}</view>
 				<view class="good-name">{{goodData.productName}}</view>
 				<view class="good-price">
-					<text class="goods-spec">¥{{goodData.bizPrice}}/{{goodData.unit}}</text>
+					<text class="goods-spec">¥{{goodData.productType == 2 ? goodData.auctionStartPrice : goodData.bizPrice}}/{{goodData.unit}}</text>
 					<text class="goods-original">原价:{{goodData.originalPrice}}</text>
 				</view>
 				<view class="good-text">库存:{{goodData.stock}}&nbsp;&nbsp;&nbsp;&nbsp;销量:{{goodData.sellCount}}</view>

+ 14 - 15
pagesMain/pickVideo.vue

@@ -34,30 +34,29 @@
 					// 必要参数 身份签名,相当于登录密码的作用
 					template: '' // 必要参数 组件模版,支持的值 1v1 grid custom ,注意:不支持动态修改, iOS 不支持 pusher 动态渲染
 				},
-				showTipToast: false
+				showTipToast: false,
+				options: null
 			}
 		},
-		onLoad(options) {
+		onLoad() {
+			wx.setKeepScreenOn({
+				keepScreenOn: true
+			}); // 获取 rtcroom 实例
+			this.options = {
+				template: '1v1'
+			}
 			NET.request(API.creatPickVideo, {}, 'GET').then(res => {
-				this.liveId = res.liveId
-				this.roomId = res.roomId
-				wx.setKeepScreenOn({
-					keepScreenOn: true
-				}); // 获取 rtcroom 实例
-
-				this.trtcComponent = this.$refs['trtc-component']; // 监听TRTC Room 关键事件
-
-				this.bindTRTCRoomEvent(); // 将String 类型的 true false 转换成 boolean
-				options.template = '1v1';
-				this.options = options; // querystring 只支持传递 String 类型, 注意类型转换
-
+				this.liveId = res.data.liveId
+				this.roomId = Number(res.data.roomId)
+				this.trtcComponent = this.$refs['trtc-component'] // 监听TRTC Room 关键事件
 				this.enterRoom({
 					roomID: this.roomId,
 					userID: uni.getStorageSync("userData").userId, //设置为用户id
 					template: '1v1',
 					debugMode: false,
-					cloudenv: 'PRO',
+					cloudenv: 'PRO'
 				});
+				this.bindTRTCRoomEvent(); // 将String 类型的 true false 转换成 boolean
 			}).catch(error => {
 				this.$refs.uTips.show({
 					title: error.data.msg,