liangtengxiong 4 سال پیش
والد
کامیت
0ff8648491
1فایلهای تغییر یافته به همراه201 افزوده شده و 167 حذف شده
  1. 201 167
      src/pages/shop/shopdetail.vue

+ 201 - 167
src/pages/shop/shopdetail.vue

@@ -141,146 +141,161 @@
 					</view>
 				</view>
 			</view>
-      <view class="warp" v-if="typeProperty === '0'">
-        <!-- 卖价 -->
-        <view class="price-warp" >
-          <view class="name">卖价:</view>
-          <input
-            class="price"
-            type="text"
-            v-model="price"
-            placeholder="请输入卖价"
-          />
-        </view>
-        <!-- 打折价 -->
-        <view class="price-warp">
-          <view class="name">划线价:</view>
-          <input
-            class="price"
-            type="text"
-            v-model="rateprice"
-            placeholder="请输入划线价"
-          />
-        </view>
-        <!-- 销售属性 -->
-        <view class="property">
-          <view class="property-warp">
-            <view class="title">销售属性</view>
-            <view class="date">
-              <view class="namebar">过期日期:</view>
-              <view class="num">2020-07</view>
-            </view>
-            <view class="pattern">
-              <view class="uni-list">
-                <radio-group @change="radioChange">
-                  <label
-                    class="uni-list-cell uni-list-cell-pd pattern-item"
-                    v-for="(item, index) in patterList"
-                    :key="index"
-                  >
-                    <view class="checkth">
-                      <radio :value="item.id" :checked="index === patterIndex" />
-                    </view>
-                    <view class="txt">
-                      <text class="txt1"> {{ item.name }}</text>
-                      <text> {{ item.know }}</text>
-                    </view>
-                  </label>
-                </radio-group>
-              </view>
-            </view>
-          </view>
-        </view>
-        <!-- 商品库存 -->
-        <view class="property">
-          <view class="property-warp">
-            <view class="title">商品库存</view>
-            <view class="pattern">
-              <view class="uni-list">
-                <radio-group @change="shopNumChange">
-                  <label
-                    class="uni-list-cell uni-list-cell-pd pattern-item"
-                    v-for="(item, index) in shopNumList"
-                    :key="index"
-                  >
-                    <view class="checkth">
-                      <radio :value="item.id" :checked="index === shopNumIndex" />
-                    </view>
-                    <view class="txt">
-                      <text class="txt1"> {{ item.name }}</text>
-                      <text> {{ item.know }}</text>
-                      <view class="inventory" v-if="item.name === '限日库存模式'">
-                        <text class="name">日库存数:</text>
-                        <input
-                          class="dateInventory"
-                          type="text"
-                          placeholder="请输入库存数量"
-                          v-model="dateInventory"
-                        />
-                      </view>
-                      <view class="inventory" v-if="item.name === '限总库存模式'">
-                        <text class="name">总库存数:</text>
-                        <input
-                          class="dateInventory"
-                          type="text"
-                          placeholder="请输入库存数量"
-                          v-model="sunInventory"
-                        />
-                      </view>
-                    </view>
-                  </label>
-                </radio-group>
-              </view>
-            </view>
-          </view>
-        </view>
-        <!-- 预定规则 -->
-        <view class="booking">
-          <view class="booking-warp">
-            <view class="title">预定规则</view>
-            <view class="model">
-              <view class="inputnum">
-                <text class="bar">预定数量:</text>
-                <input
-                  class="bookingnum"
-                  v-model="bookingnum"
-                  type="text"
-                  placeholder="请输入数量"
-                />
-              </view>
-              <view class="txt">一天内同一身份证可预定数量</view>
-            </view>
-            <view class="truename">
-              <view class="truename-warp">
-                <view class="txt">是否开启实名制购票</view>
-                <switch :checked="trueNme" @change="trueNmeChange" />
-              </view>
-            </view>
-            <view class="modeltwo">
-              <view class="uni-list">
-                <radio-group @change="bookingChange">
-                  <label
-                    class="uni-list-cell uni-list-cell-pd booking-item"
-                    v-for="(item, index) in bookingList"
-                    :key="index"
-                  >
-                    <view class="checkth">
-                      <radio :value="item.id" :checked="index === bookingIndex" />
-                    </view>
-                    <view class="txt">{{ item.name }}</view>
-                  </label>
-                </radio-group>
-              </view>
-            </view>
-            <view class="truename">
-              <view class="truename-warp">
-                <view class="txt">订单显示二维码</view>
-                <switch :checked="codeShow" @change="codeShowChange" />
-              </view>
-            </view>
-          </view>
-        </view>
-      </view>
+			<view class="warp" v-if="typeProperty === '0'">
+				<!-- 卖价 -->
+				<view class="price-warp">
+					<view class="name">卖价:</view>
+					<input
+						class="price"
+						type="text"
+						v-model="price"
+						placeholder="请输入卖价"
+					/>
+				</view>
+				<!-- 打折价 -->
+				<view class="price-warp">
+					<view class="name">划线价:</view>
+					<input
+						class="price"
+						type="text"
+						v-model="rateprice"
+						placeholder="请输入划线价"
+					/>
+				</view>
+				<!-- 销售属性 -->
+				<view class="property">
+					<view class="property-warp">
+						<view class="title">销售属性</view>
+						<view class="date">
+							<view class="namebar">过期日期:</view>
+							<view class="num" @tap="openTime"> {{ expirationDate }}</view>
+						</view>
+						<view class="pattern">
+							<view class="uni-list">
+								<radio-group @change="radioChange">
+									<label
+										class="uni-list-cell uni-list-cell-pd pattern-item"
+										v-for="(item, index) in patterList"
+										:key="index"
+									>
+										<view class="checkth">
+											<radio
+												:value="item.id"
+												:checked="index === patterIndex"
+											/>
+										</view>
+										<view class="txt">
+											<text class="txt1"> {{ item.name }}</text>
+											<text> {{ item.know }}</text>
+										</view>
+									</label>
+								</radio-group>
+							</view>
+						</view>
+					</view>
+				</view>
+				<!-- 商品库存 -->
+				<view class="property">
+					<view class="property-warp">
+						<view class="title">商品库存</view>
+						<view class="pattern">
+							<view class="uni-list">
+								<radio-group @change="shopNumChange">
+									<label
+										class="uni-list-cell uni-list-cell-pd pattern-item"
+										v-for="(item, index) in shopNumList"
+										:key="index"
+									>
+										<view class="checkth">
+											<radio
+												:value="item.id"
+												:checked="index === shopNumIndex"
+											/>
+										</view>
+										<view class="txt">
+											<text class="txt1"> {{ item.name }}</text>
+											<text> {{ item.know }}</text>
+											<view
+												class="inventory"
+												v-if="item.name === '限日库存模式'"
+											>
+												<text class="name">日库存数:</text>
+												<input
+													class="dateInventory"
+													type="text"
+													placeholder="请输入库存数量"
+													v-model="dateInventory"
+												/>
+											</view>
+											<view
+												class="inventory"
+												v-if="item.name === '限总库存模式'"
+											>
+												<text class="name">总库存数:</text>
+												<input
+													class="dateInventory"
+													type="text"
+													placeholder="请输入库存数量"
+													v-model="sunInventory"
+												/>
+											</view>
+										</view>
+									</label>
+								</radio-group>
+							</view>
+						</view>
+					</view>
+				</view>
+				<!-- 预定规则 -->
+				<view class="booking">
+					<view class="booking-warp">
+						<view class="title">预定规则</view>
+						<view class="model">
+							<view class="inputnum">
+								<text class="bar">预定数量:</text>
+								<input
+									class="bookingnum"
+									v-model="bookingnum"
+									type="text"
+									placeholder="请输入数量"
+								/>
+							</view>
+							<view class="txt">一天内同一身份证可预定数量</view>
+						</view>
+						<view class="truename">
+							<view class="truename-warp">
+								<view class="txt">是否开启实名制购票</view>
+								<switch :checked="trueNme" @change="trueNmeChange" />
+							</view>
+						</view>
+						<view class="modeltwo">
+							<view class="uni-list">
+								<radio-group @change="bookingChange">
+									<label
+										class="uni-list-cell uni-list-cell-pd booking-item"
+										v-for="(item, index) in bookingList"
+										:key="index"
+									>
+										<view class="checkth">
+											<radio
+												:value="item.id"
+												:checked="index === bookingIndex"
+											/>
+										</view>
+										<view class="txt">{{ item.name }}</view>
+									</label>
+								</radio-group>
+							</view>
+						</view>
+						<view class="truename">
+							<view class="truename-warp">
+								<view class="txt">订单显示二维码</view>
+								<switch :checked="codeShow" @change="codeShowChange" />
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
 			<!-- 商品图标 -->
 			<view class="shopicon">商品图标</view>
 			<view class="iconcontent">
@@ -326,6 +341,12 @@
 
 			<view class="btn" @tap="submitMesage">确认</view>
 			<rf-loading v-if="loading"></rf-loading>
+			<uni-calendar
+				ref="calendar"
+				:insert="false"
+				:range="false"
+				@confirm="confirm"
+			/>
 		</view>
 	</view>
 </template>
@@ -333,9 +354,12 @@
 <script>
 let myCloud;
 import Header from '../components/header.vue';
+import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
+import moment from '@/common/moment';
 export default {
 	components: {
-		Header
+		Header,
+		uniCalendar
 	},
 	data() {
 		return {
@@ -353,7 +377,7 @@ export default {
 			storeIndex: 0,
 			storeId: '',
 			storeDisable: true,
-			typeProperty: '1', // 判断所属店铺是否是自营店铺  1分销  0自营
+			typeProperty: '0', // 判断所属店铺是否是自营店铺  1分销  0自营
 
 			typeList: [{ name: '商品类型(请先选择所属店铺)', id: '' }],
 			typeIndex: 0,
@@ -386,7 +410,8 @@ export default {
 
 			SHOPID: 0,
 			shopData: {},
-
+			
+			expirationDate: moment().format('YYYY-MM-DD'),
 			// 销售属性
 			patterList: [
 				{
@@ -423,10 +448,10 @@ export default {
 				{ id: '1', name: '过期不可退' },
 				{ id: '2', name: '统一不可退' }
 			],
-      bookingIndex: 0,
-      
-      trueNme: true,
-      codeShow: true
+			bookingIndex: 0,
+
+			trueNme: true,
+			codeShow: true
 		};
 	},
 	onUnload() {
@@ -448,6 +473,14 @@ export default {
 		}
 	},
 	methods: {
+		// 打开日历
+		openTime() {
+      this.$refs.calendar.open();
+		},
+		confirm (e) {
+			console.log(e);
+			this.expirationDate = e.fulldate
+		},
 		// 单选自定义属性
 		radioChange: function(evt) {
 			for (let i = 0; i < this.patterList.length; i++) {
@@ -474,14 +507,15 @@ export default {
 					break;
 				}
 			}
-    },
-    // 实名制
-    trueNmeChange (e) {
-      console.log(e.detail.value);
-    },
-    codeShowChange (e){
-      console.log(e.detail.value);
-    },
+		},
+		// 实名制
+		trueNmeChange(e) {
+			console.log(e.detail.value);
+		},
+		// 显示二维码
+		codeShowChange(e) {
+			console.log(e.detail.value);
+		},
 		// 获取单个商品信息
 		async getShopBuyId() {
 			if (!this.SHOPID) return;
@@ -1055,8 +1089,8 @@ export default {
 			align-items: center;
 			height: 93upx;
 			.name {
-				font-size: 32upx;
-				color: #a3a8a8;
+				font-size: 28upx;
+				color: #232828;
 			}
 			.price {
 				flex: 1;
@@ -1080,7 +1114,7 @@ export default {
 					.namebar {
 						font-size: 28upx;
 						line-height: 93upx;
-						color: #a3a8a8;
+						color: #232828;
 					}
 					.num {
 						flex: 1;
@@ -1152,15 +1186,15 @@ export default {
 						color: #a3a8a8;
 					}
 				}
-        .truename {
-          .truename-warp {
-            padding: 20upx 33upx;
-            display: flex;
-            justify-content: space-between;
-            border-bottom: 1px solid #e7e7e7;
-            background-color: #fff;
-          }
-        }
+				.truename {
+					.truename-warp {
+						padding: 20upx 33upx;
+						display: flex;
+						justify-content: space-between;
+						border-bottom: 1px solid #e7e7e7;
+						background-color: #fff;
+					}
+				}
 				.modeltwo {
 					.booking-item {
 						display: flex;