Bladeren bron

订单详情接口完成,商品管理根据名称、状态、商铺条件对接,商品
新增完成部分(所属店铺,商品类型,商品名称,分类,图片上传)

ltx529596 4 jaren geleden
bovenliggende
commit
681b5aac3e

+ 2 - 2
src/config/index.config.js

@@ -3,7 +3,7 @@ const CONFIG = {
     development: {
         assetsPath: '/static', // 静态资源路径
         // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
-        baseUrl: 'http://192.168.100.175:83/merch',  // 后台接口请求地址
+        baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
         hostUrl: 'http://localhost:8080',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid
@@ -12,7 +12,7 @@ const CONFIG = {
     production: {
         assetsPath: '/static', // 静态资源路径
         // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
-        baseUrl: 'http://192.168.100.175:83/merch',  // 后台接口请求地址
+        baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
         hostUrl: 'http://h5.tinyshop.rageframe.com',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid

+ 1 - 1
src/pages/index/conversion.vue

@@ -13,7 +13,7 @@
           >店铺名称:<text class="txt">{{ orderDetail.shopName }}</text></view
         >
         <view class="waternum titlebar"
-          >流水号:<text class="txt">观光车</text></view
+          >流水号:<text class="txt">{{orderDetail.outOrderNo}}</text></view
         >
         <view class="ordernum titlebar"
           >订单号:<text class="txt">{{ orderDetail.ordersNo }}</text></view

+ 14 - 32
src/pages/order/order.vue

@@ -88,7 +88,7 @@
     <view class="order-content" v-if="isactive === 1">
       <view
         class="order-list"
-        @tap="todetail"
+        @tap="todetail(item.ordersNo)"
         v-for="(item, index) in orderList"
         :key="index"
       >
@@ -118,7 +118,7 @@
     <view class="order-content" v-if="isactive === 2">
       <view
         class="order-list"
-        @tap="todetail"
+        @tap="todetail(item.ordersNo)"
         v-for="(item, index) in orderList"
         :key="index"
       >
@@ -148,7 +148,7 @@
     <view class="order-content" v-if="isactive === 3">
       <view
         class="order-list"
-        @tap="todetail"
+        @tap="todetail(item.ordersNo)"
         v-for="(item, index) in orderList"
         :key="index"
       >
@@ -208,26 +208,18 @@ export default {
       sunday: 0,
 
       orderFlag: 'pay', // pay accomplish refundorder
-      pageNum: 1,
-      pageSize: 10,
-      pages: 0,
-      pageTotal: 0,
-      orderList: [],
-      orderbynumber: '',
-      orderbyphone: '',
-      orderbytime: [],
-      orderbyshop: '',
 
       soleStatus: 1, // 触底状态
 
+      orderList: [],
       params: {
-        orderFlag: 'pay',
+        orderFlag: 'pay', // pay accomplish refundorder
         pageNum: 1,
         pageSize: 10,
         ordersNo: '',
         buyPhone: '',
         shopId: '',
-        overTimeArray:[]
+        overTimeArray: [],
       },
     };
   },
@@ -257,36 +249,24 @@ export default {
   },
   //方法集合
   methods: {
-    /*
-      orderFlag 必传:【已付款:pay;已完成:accomplish;退款:refundorder】
-      选填: 时间段查询条件参数:overTimeArray[] 
-            订单号参数:ordersNo
-            手机号参数:buyPhone
-            店铺id:shopId
-            分页pageNum和pageSize
-            202005191542296097981
-            18716571247
-    */
-
     // 打开日历
     openTime() {
       this.$refs.calendar.open();
     },
     // 确认时间后
     confirm(e) {
-      this.more = 'loading'
+      this.more = 'loading';
       this.loading = true;
 
       this.startdate = e.range.before;
       this.enddate = e.range.after;
       this.sunday = e.range.data.length;
-      
+
       this.params.overTimeArray.push(this.startdate, this.enddate);
 
-      this.getOrderList()
-      
+      this.getOrderList();
     },
-   
+
     // 根据订单号或者手机号查询
     orderByNum() {
       this.more = 'loading';
@@ -320,8 +300,10 @@ export default {
       this.getOrderList();
     },
     // 跳转详情
-    todetail() {
-      this.$mRouter.push({ route: '' });
+    todetail(num) {
+      console.log(num);
+      uni.setStorageSync('order', num);
+      this.$mRouter.push({ route: '/pages/order/orderdetail' });
     },
     // 获取店铺列表
     async getShopList() {

+ 30 - 17
src/pages/order/orderdetail.vue

@@ -6,26 +6,28 @@
 		<view class="order-detail-content">
 			<view class="order-message">
 				<view class="title">订单信息</view>
-				<view class="ordername titlebar">产品名称:<text class="txt">观光车</text></view>
-				<view class="shopname titlebar">店铺名称:<text class="txt">观光车</text></view>
-				<view class="waternum titlebar">流水号:<text class="txt">观光车</text></view>
-				<view class="ordernum titlebar">订单号:<text class="txt">观光车</text></view>
-				<view class="phonenum titlebar">手机号:<text class="txt">观光车</text></view>
-				<view class="goindate titlebar">入园日期:<text class="txt">观光车</text></view>
-				<view class="price titlebar">产品价格:<text class="txt">观光车</text></view>
-				<view class="buynum titlebar">购买数量:<text class="txt">观光车</text></view>
-				<view class="palytime titlebar">游玩时间:<text class="txt">观光车</text></view>
-				<view class="orderstatus titlebar">订单状态:<text class="txt">退款中</text> </view>
+				<view class="ordername titlebar">产品名称:<text class="txt">{{orderMessage.goodsName }}</text></view>
+				<view class="shopname titlebar">店铺名称:<text class="txt">{{orderMessage.shopName}}</text></view>
+				<view class="waternum titlebar">流水号:<text class="txt">{{orderMessage.outOrderNo}}</text></view>
+				<view class="ordernum titlebar">订单号:<text class="txt">{{orderMessage.ordersNo}}</text></view>
+				<view class="phonenum titlebar">手机号:<text class="txt">{{orderMessage.buyPhone}}</text></view>
+				<view class="goindate titlebar">入园日期:<text class="txt">{{orderMessage.orderTime}}</text></view>
+				<view class="price titlebar">产品价格:<text class="txt">{{orderMessage.ordersPrice}}</text></view>
+				<view class="buynum titlebar">购买数量:<text class="txt">{{orderMessage.playManList.length}}</text></view>
+				<view class="palytime titlebar">游玩时间:<text class="txt">{{orderMessage.payTime}}</text></view>
+				<view class="orderstatus titlebar">订单状态:<text class="txt">{{orderMessage.remark}}</text> </view>
 				<view class="tourist">
 					<view class="title">游客信息</view>
-					<view class="name touristbar">姓名:<text class="txt">猪猪虾</text></view>
-					<view class="idcard touristbar">身份证:<text class="txt">500233199308278293</text></view>
+					<view v-for="(item,index) in orderMessage.playManList" :key="index">
+						<view class="name touristbar">姓名:<text class="txt">{{item.name}}</text></view>
+						<view class="idcard touristbar">身份证:<text class="txt">{{item.idcard}}</text></view>
+					</view>
 				</view>
 			</view>
 			<view class="paymessage">
 				<view class="title">支付信息</view>
-				<view class="shoppric">产品价格:<text class="money">¥280</text></view>
-				<view class="realitypirc">实付金额:<text class="money">¥280</text></view>
+				<view class="shoppric">产品价格:<text class="money">¥{{orderMessage.ordersPrice}}</text></view>
+				<view class="realitypirc">实付金额:<text class="money">¥{{orderMessage.ordersPrice}}</text></view>
 			</view>
 		</view>
 	</view>
@@ -39,14 +41,25 @@
 		},
 		data() {
 			return {
-				title: '订单详情'
+				title: '订单详情',
+				orderMessage: {}
 			}
 		},
 		onLoad() {
-
+			this.ordernum = uni.getStorageSync('order')
+			this.getOrderDetail()
 		},
 		methods: {
-
+			
+			// 详情
+			async getOrderDetail () {
+				await this.$http.get('/orders/getOrdersByNo/'+this.ordernum).then(async (res)=>{
+					console.log(res);
+					if (res.data) {
+						this.orderMessage = res.data
+					} 
+				})
+			}
 		}
 	}
 </script>

+ 133 - 109
src/pages/shop/shop.vue

@@ -26,12 +26,16 @@
             placeholder-style="color:#a3a8a8;font-size:10px;"
             placeholder="请输入商品名称"
             class="cellphone"
-						v-model="params.name"
+            v-model="params.name"
           />
           <text class="txt" @tap="searchByname">搜索</text>
         </view>
         <view class="btn-time">
-          <image src="../../static/images/addicon.png" class="timeicon" @tap="addShop"></image>
+          <image
+            src="../../static/images/addicon.png"
+            class="timeicon"
+            @tap="addShop"
+          ></image>
         </view>
       </view>
       <view class="header-bar">
@@ -89,7 +93,7 @@
         </view>
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
-          <view class="btn sold">下架</view>
+          <view class="btn sold" @tap="passGet(item.id)">审核</view>
           <view class="btn compile" @tap="topage">编辑</view>
           <view class="btn delete">删除</view>
         </view>
@@ -121,7 +125,7 @@
         </view>
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
-          <view class="btn sold">下架</view>
+          <view class="btn sold" @tap="shopPutDown(item.id)">下架</view>
           <view class="btn compile" @tap="topage">编辑</view>
           <view class="btn delete">删除</view>
         </view>
@@ -153,7 +157,7 @@
         </view>
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
-          <view class="btn sold">下架</view>
+          <view class="btn sold" @tap="shopPutUp">上架</view>
           <view class="btn compile" @tap="topage">编辑</view>
           <view class="btn delete">删除</view>
         </view>
@@ -180,25 +184,24 @@ export default {
       shopID: 0,
       index: 0,
 
-			isactive: 1,
-			soleStatus: 1,  // 触底状态
+      isactive: 1,
+      soleStatus: 1, // 触底状态
 
       shoplist: [],
 
       // 列表参数
-      pagenum: 1,
-			pagesize: 10,
       putAwat: '1', // 已上架1;已下架0
       status: '1', // 待审核:1,审核通过:2,审核未通过:3
-			params: {
-				pageNum: 1,
-				pageSize: 10,
-				mid: 0,   // 景区id
-				status: '1',  // 审核状态
-				upDown: '',   // 上下架状态
-				shopId: '',   // 商铺id 选择框
-				name: ''
-			}
+
+      params: {
+        pageNum: 1,
+        pageSize: 10,
+        mid: 0, // 景区id
+        status: '1', // 审核状态
+        upDown: '', // 上下架状态
+        shopId: '', // 商铺id 选择框
+        name: '',
+      },
     };
   },
   filters: {
@@ -222,39 +225,41 @@ export default {
   // 下拉刷新
   onPullDownRefresh() {},
   // 上拉加载
-	onReachBottom() {
-		if (this.soleStatus === 1) {
-			if (this.more === 'noMore') {
-				return
-			}
-			this.getMoreByStatus()
-		}
-	},
-	
+  onReachBottom() {
+    if (this.soleStatus === 1) {
+      if (this.more === 'noMore') {
+        return;
+      }
+      this.getMoreByStatus();
+    }
+  },
+
   onLoad() {
     this.getShopList();
     this.getShopMessage();
   },
   //方法集合
   methods: {
-		// 新增商品
-		addShop(){
-			this.$mRouter.push({route: '/pages/shop/shopdetail'})
-		},
-		// 根据名字搜索
-		searchByname() {
-			this.params.pageNum =1
-			this.getTicketShopList()
-			console.log(this.params.name);
-		},
+    // 新增商品
+    addShop() {
+      this.$mRouter.push({ route: '/pages/shop/shopdetail' });
+    },
+    // 根据名字搜索
+    searchByname() {
+      this.more = 'loading';
+      this.params.pageNum = 1;
+      this.getTicketShopList();
+      console.log(this.params.name);
+    },
     // 选择商铺
     bindPickerChange(e) {
-			this.params.pageNum = 1
+      this.more = 'loading';
+      this.params.pageNum = 1;
       this.shopID = null;
       this.index = e.detail.value;
-			this.params.shopId= this.shopArray[this.index].id;
-			console.log(this.params.shopId);
-			this.getTicketShopList()
+      this.params.shopId = this.shopArray[this.index].id;
+      console.log(this.params.shopId);
+      this.getTicketShopList();
     },
     // 获取店铺列表
     async getShopList() {
@@ -268,29 +273,33 @@ export default {
     // 商家信息
     async getShopMessage() {
       await this.$http.get('/getUserInfo').then(async (res) => {
-				if (res.data) {
-					this.params.mid = res.data.id;
-					this.getTicketShopList()
-				}
+        if (res.data) {
+          uni.setStorageSync('scenicId', res.data.id)
+          this.params.mid = res.data.id;
+          this.getTicketShopList();
+        }
       });
-		},
-		// 待审核tab切换
-		changeTabByStatus(type, status) {
-			this.shoplist = []
-			this.params.pageNum = 1
-			this.isactive = type
-			this.params.status = status
-			delete this.params.upDown
-			this.getTicketShopList()
-		},
+    },
+    // 待审核tab切换
+    changeTabByStatus(type, status) {
+      this.more = 'loading';
+      this.shoplist = [];
+      this.params.pageNum = 1;
+      this.isactive = type;
+      this.params.status = status;
+      this.status = status
+      delete this.params.upDown;
+      this.getTicketShopList();
+    },
     // tab
-    changeTab(type,putaway) {
-      this.more = 'noMore'
-			this.params.pageNum = 1
-			this.isactive = type;
-			this.params.upDown = putaway
-			delete this.params.status
-			this.getTicketShopList()
+    changeTab(type, putaway) {
+      this.more = 'loading';
+      this.params.pageNum = 1;
+      this.isactive = type;
+      this.params.upDown = putaway;
+      this.putAwat = putaway
+      delete this.params.status;
+      this.getTicketShopList();
     },
     // 置顶
     sticktop(e) {
@@ -305,57 +314,72 @@ export default {
     },
     // 商品列表(待审核状态)
     async getTicketShopList() {
-			this.soleStatus = 1
-			this.shoplist = []
-
-			// 判断tab切换的条件
-			if (this.params.upDown === '1' || this.params.upDown === '0') {
-				delete this.params.status
-			} else {
-				delete this.params.upDown
-			}
-
-      await this.$http
-        .get('/goods/list', this.params)
-        .then((res) => {
-					console.log(res);
-          if (res.data.list.length > 0) {
-						this.shoplist = res.data.list;
-						console.log(this.shoplist);
-						if (res.data.nextPage === 0) {
-							this.more = 'noMore'
-						}
-          } else {
-						this.more ='noMore'
-					}
-        });
+      this.soleStatus = 1;
+      this.shoplist = [];
+
+      // 判断tab切换的条件
+      if (this.params.upDown === '1' || this.params.upDown === '0') {
+        delete this.params.status;
+      } else {
+        delete this.params.upDown;
+      }
+
+      await this.$http.get('/goods/list', this.params).then((res) => {
+        console.log(res);
+        if (res.data.list.length > 0) {
+          this.shoplist = res.data.list;
+          console.log(this.shoplist);
+          if (res.data.nextPage === 0) {
+            this.more = 'noMore';
+          }
+        } else {
+          this.more = 'noMore';
+        }
+      });
     },
     // 更多(待审核状态)
     async getMoreByStatus() {
-			this.params.pageNum++;
-			let listArr =[]
-				// 判断tab切换的条件
-			if (this.params.upDown === '1' || this.params.upDown === '0') {
-				delete this.params.status
-			} else {
-				delete this.params.upDown
-			}
-      await this.$http
-        .get('/goods/list', this.params)
-        .then((res) => {
-					console.log(res);
-          if (res.data.list.length > 0) {
-						listArr = res.data.list
-						this.shoplist = this.shoplist.concat(listArr)
-						if (res.data.nextPage === 0) {
-							this.more = 'noMore'
-						}
-          } else {
-						this.more = 'noMore'
-						return
-					}
-        });
+      this.params.pageNum++;
+      let listArr = [];
+      // 判断tab切换的条件
+      if (this.params.upDown === '1' || this.params.upDown === '0') {
+        delete this.params.status;
+      } else {
+        delete this.params.upDown;
+      }
+      await this.$http.get('/goods/list', this.params).then((res) => {
+        console.log(res);
+        if (res.data.list.length > 0) {
+          listArr = res.data.list;
+          this.shoplist = this.shoplist.concat(listArr);
+          if (res.data.nextPage === 0) {
+            this.more = 'noMore';
+          }
+        } else {
+          this.more = 'noMore';
+          return;
+        }
+      });
+    },
+    // 通过审核
+    passGet(id) {
+      console.log(id);
+    },
+    // 下架
+    shopPutDown(id) {
+      console.log(this.params.upDown);
+      this.changeShopStatus(id,this.params.upDown)
     },
+    // 上架
+    shopPutUp() {
+      console.log(2);
+    },
+    // 修改商品状态
+    async changeShopStatus(ids,state) {
+      await this.$http.postP('/goods/changeStatusOrUpDown',{id:10,upDown:1}).then( async(res)=>{
+        console.log(res);
+      })
+    }
   },
 };
 </script>

+ 344 - 99
src/pages/shop/shopdetail.vue

@@ -6,78 +6,154 @@
       <!-- 所属店铺 -->
       <view class="shop detail-list">
         <view class="menu">
-          <view class="title">所属店铺</view>
-          <image src="../../static/images/moreicon.png" class="more"></image>
+          <view class="uni-list-cell">
+            <view class="uni-list-cell-db">
+              <picker
+                class="selectlist"
+                mode="selector"
+                @change="changeStore"
+                :value="0"
+                :range="storeList"
+                range-key="name"
+              >
+                <view class="uni-input title">{{
+                  storeList[storeIndex].name
+                }}</view>
+              </picker>
+              <image
+                src="../../static/images/moreicon.png"
+                class="more"
+              ></image>
+            </view>
+          </view>
         </view>
       </view>
       <!-- 商品类型 -->
       <view class="shoptype detail-list noborder">
         <view class="menu">
-          <view class="title">商品类型</view>
-          <image src="../../static/images/moreicon.png" class="more"></image>
+          <view class="uni-list-cell">
+            <view class="uni-list-cell-db">
+              <picker
+                @change="changeType"
+                :value="typeIndex"
+                :range="typeList"
+                range-key="name"
+                class="selectlist"
+              >
+                <view class="uni-input title">{{
+                  typeList[typeIndex].name
+                }}</view>
+              </picker>
+              <image
+                src="../../static/images/moreicon.png"
+                class="more"
+              ></image>
+            </view>
+          </view>
         </view>
       </view>
       <!-- 商品名称 -->
       <view class="shopname detail-list">
         <view class="menu">
-          <view class="title">商品名称</view>
-          <image src="../../static/images/moreicon.png" class="more"></image>
+          <view class="uni-list-cell">
+            <view class="uni-list-cell-db">
+              <picker
+                @change="changeShop"
+                :value="shopIndex"
+                :range="shopList"
+                range-key="name"
+                class="selectlist"
+              >
+                <view class="uni-input title">{{
+                  shopList[shopIndex].name
+                }}</view>
+              </picker>
+              <image
+                src="../../static/images/moreicon.png"
+                class="more"
+              ></image>
+            </view>
+          </view>
         </view>
       </view>
       <!-- 自定义分类 -->
       <view class="classify detail-list noborder">
         <view class="menu">
           <view class="title bigtitle">自定义分类</view>
-          <view class="txt">管理分类</view>
+          <view class="txt" @tap="toClassify">管理分类</view>
         </view>
       </view>
       <!-- 西线推荐 -->
       <view class="xiline detail-list noborder">
         <view class="menu">
-          <view class="title linetitle">西线推荐</view>
-          <image src="../../static/images/moreicon.png" class="more"></image>
+          <view class="uni-list-cell">
+            <view class="uni-list-cell-db">
+              <picker
+                @change="changeClassify"
+                :value="lineIndex"
+                :range="lineList"
+                range-key="name"
+                class="selectlist"
+              >
+                <view class="uni-input title">{{
+                  lineList[lineIndex].name
+                }}</view>
+              </picker>
+              <image
+                src="../../static/images/moreicon.png"
+                class="more"
+              ></image>
+            </view>
+          </view>
         </view>
       </view>
       <!-- 账号限制 -->
       <view class="idastrict detail-list noborder">
         <view class="menu">
           <view class="title astricttitle">账号限制</view>
-          <switch @change="Change" />
+          <switch :checked="showoperat" @change="Change" />
         </view>
       </view>
       <!-- 账号限制 -->
       <view class="detail-list noborder operat" v-if="showoperat">
         <view class="menu">
-          <view class="title">同一账号</view>
-          <view class="sub">-</view><text class="num1">{{ num1 }}</text
-          ><view class="add">+</view>
+          <view class="title">同一账号在</view>
+          <view class="sub" @tap="subtractUser">-</view>
+          <text class="num1">{{ num1 }}</text>
+          <view class="add" @tap="addUser">+</view>
           <view class="txt">天内最多购买</view>
-          <view class="sub">-</view><text class="num2">{{ num2 }}</text
-          ><view class="add">+</view><text class="unit">张</text>
+          <view class="sub" @tap="subtractDate">-</view
+          ><text class="num2">{{ num2 }}</text
+          ><view class="add" @tap="addDate">+</view><text class="unit">张</text>
         </view>
       </view>
-			<!-- 商品图标 -->
-			<view class="shopicon">商品图标</view>
-			<view class="iconcontent"><text class="icon"></text></view>
-			<view class="shopicon">商品图册</view>
-			<view class="uploading">
-
-			</view>
-			<!-- 购票须知 -->
-			<view class="shopicon">商品描述(购票须知)</view>
-			<view class="know">
-				<view class="txt-list">服务信息</view>
-				<view class="txt-list">本商品支付完成即可顺利出行,无需等待确认</view>
-				<view class="txt-list">本商品无需出团通知书/确认单,预定成功后即可出行</view>
-				<view class="txt-list">取消政策</view>
-				<view class="txt-list">按规则退</view>
-				<view class="txt-list">旅游者违约退改规则</view>
-				<view class="txt-list">购买须知</view>
-				<view class="txt-list">商品过了使用期限后将不可再使用,请您一定要在使用时间</view>
-				<view class="txt-list">范围内及时使用哦</view>
-			</view>
+      <!-- 商品图标 -->
+      <view class="shopicon">商品图标</view>
+      <view class="iconcontent">
+        <text class="icon" @tap="uploadImg"></text>
+        <image class="shopLogo" :src="img"></image>
+      </view>
+      <view class="shopicon">商品图册</view>
+      <view class="uploading"> </view>
+      <!-- 购票须知 -->
+      <view class="shopicon">商品描述(购票须知)</view>
+      <view class="know">
+        <view class="txt-list">服务信息</view>
+        <view class="txt-list">本商品支付完成即可顺利出行,无需等待确认</view>
+        <view class="txt-list"
+          >本商品无需出团通知书/确认单,预定成功后即可出行</view
+        >
+        <view class="txt-list">取消政策</view>
+        <view class="txt-list">按规则退</view>
+        <view class="txt-list">旅游者违约退改规则</view>
+        <view class="txt-list">购买须知</view>
+        <view class="txt-list"
+          >商品过了使用期限后将不可再使用,请您一定要在使用时间</view
+        >
+        <view class="txt-list">范围内及时使用哦</view>
+      </view>
 
-			<view class="btn">确认</view>
+      <view class="btn">确认</view>
     </view>
   </view>
 </template>
@@ -90,18 +166,168 @@ export default {
   },
   data() {
     return {
+      scenicId: uni.getStorageSync('scenicId'),
       title: '商品详情',
       num1: 1,
-			num2: 2,
-			showoperat: false
+      num2: 9999,
+      showoperat: true,
+      img: '',
+      storeList: [{ name: '所属店铺', id: '' }],
+      storeIndex: 0,
+      storeId: '',
+
+      typeList: [{ name: '商品类型(请先选择所属店铺)', id: '' }],
+      typeIndex: 0,
+      typeId: '',
+
+      shopList: [{ name: '商品名称(请先选择商品类型)', id: '' }],
+      shopIndex: 0,
+      shopId: '',
+
+      hasNameList: 0, // 判断是否有商品名称列表
+
+      lineList: [{ name: '分类(请先选择所属商品)', id: '' }],
+      lineIndex: 0,
+      lineId: '',
     };
   },
-  onLoad() {},
+  onLoad() {
+    this.getShopList();
+  },
   methods: {
+    // 跳转到管理分类页面
+    toClassify() {
+      console.log('我跳了');
+    },
+    // 选择店铺
+    changeStore(e) {
+      this.storeIndex = e.detail.value;
+      this.storeId = this.storeList[this.storeIndex].id;
+
+      // 未选择商铺不能进行商铺类型选择
+      if (this.storeId != '') {
+        this.getType();
+        this.getLine(); // 判断是否有商品名称列表
+      }
+    },
+    // 选择商品类型
+    changeType(e) {
+      this.typeIndex = e.detail.value;
+      this.typeId = this.typeList[this.typeIndex].id;
+      if (this.typeId != '') {
+        this.getShopName();
+      }
+    },
+    // 商品名称选择
+    changeShop(e) {
+      this.shopIndex = e.detail.value;
+      this.shopId = this.shopList[this.shopIndex].id;
+    },
+    // 分类
+    changeClassify(e) {
+      this.lineIndex = e.detail.value;
+      this.lineId = this.lineList[this.lineIndex].id;
+    },
+    // 所属店铺
+    async getShopList() {
+      await this.$http
+        .get('/shop/getList', {
+          mid: this.scenicId,
+        })
+        .then(async (res) => {
+          if (res.data) {
+            let arr = [];
+            res.data.forEach((element) => {
+              arr.push({ name: element.name, id: element.id });
+            });
+            this.storeList = this.storeList.concat(arr);
+          }
+        });
+    },
+    // 商品类型
+    async getType() {
+      this.$http
+        .get('/type/getTypeListByShopId', {
+          id: this.storeId,
+        })
+        .then((res) => {
+          let arr = [];
+          res.data[0].children.forEach((element) => {
+            arr.push({ name: element.name, id: element.id });
+          });
+          this.typeList = this.typeList.concat(arr);
+        });
+    },
+    // 商品名称
+    async getShopName() {
+      await this.$http
+        .get('/goods/getTicketGoods', {
+          typeId: this.typeId,
+          shopId: this.storeId,
+        })
+        .then(async (res) => {
+          let arr = [];
+          res.data.forEach((element) => {
+            arr.push({ name: element.ticket_name, id: element.shopId });
+          });
+          this.shopList = this.shopList.concat(arr);
+          console.log(this.shopList);
+        });
+    },
+    // 线路分配
+    async getLine() {
+      await this.$http
+        .get('/goods/getCustomGroupList', {
+          shopId: this.storeId,
+        })
+        .then(async (res) => {
+          let arr = [];
+          this.hasNameList = res.data.shopFrom;
+          res.data.customGroupList.forEach((element) => {
+            arr.push({ name: element.name, id: element.id });
+          });
+          this.lineList = this.lineList.concat(arr);
+        });
+    },
     // 账号限制
     Change(e) {
-			console.log(e);
-			this.showoperat = e.detail.value
+      console.log(e);
+      this.showoperat = e.detail.value;
+    },
+    subtractUser() {
+      if (this.num1 <= 1) {
+        this.$mHelper.toast('最少一天');
+        return;
+      } else {
+        this.num1--;
+      }
+    },
+    addUser() {
+      this.num1++;
+    },
+    subtractDate() {
+      if (this.num2 <= 1) {
+        this.$mHelper.toast('最少一张票');
+        return;
+      } else {
+        this.num2--;
+      }
+    },
+    addDate() {
+      this.num2++;
+    },
+
+    // 图片上传
+    uploadImg() {
+      uni.chooseImage({
+        count: 1, //
+        sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+        sourceType: ['album'], // camera 使用相机   album 从相册中选
+        success: function (res) {  // 成功则返回图片的本地文件路径列表 tempFilePaths
+          console.log(res);
+          console.log(JSON.stringify(res.tempFilePaths));
+        },
+      });
     },
   },
 };
@@ -121,6 +347,21 @@ export default {
         justify-content: space-between;
         align-items: center;
         height: 93upx;
+        .uni-list-cell {
+          width: 100%;
+          display: flex;
+          align-items: center;
+          height: 93upx;
+          .uni-list-cell-db {
+            height: 100%;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .selectlist {
+              width: 100%;
+            }
+          }
+        }
         .title {
           font-size: 30upx;
           color: #a3a8a8;
@@ -158,11 +399,11 @@ export default {
       background-color: #fff;
     }
     .operat {
-			background-color: #f9f9f9;
+      background-color: #f9f9f9;
       .menu {
         .title {
           font-size: 28upx;
-					color: #232828;
+          color: #232828;
         }
         .sub,
         .add {
@@ -171,65 +412,69 @@ export default {
           border-radius: 50%;
           border: 1px solid #b4b8b7;
           color: #b4b8b7;
-					text-align: center;
-					line-height: 40upx;
-					font-weight: 700;
+          text-align: center;
+          line-height: 40upx;
+          font-weight: 700;
+        }
+        .txt {
+          color: #232828;
+          font-weight: normal;
+        }
+        .unit {
+          color: #232828;
         }
-				.txt {
-					color: #232828;
-					font-weight: normal;
-				}
-				.unit {
-					color: #232828;
-				}
       }
     }
-		.shopicon {
-			height: 100upx;
-			padding: 0 33upx;
-			font-size: 32upx;
-			color: #232828;
-			font-weight: 700;
-			line-height: 100upx;
-		}
-		.iconcontent {
-			padding: 0 33upx;
-			background-color: #f9f9f9;
-			display: flex;
-			align-items: center;
-			height: 100upx;
-			.icon {
-				display: inline-block;
-				width: 56upx;
-				height: 56upx;
-				background-color: #b4b8b7;
-				border-radius: 50%;
-			}
-		}
-		.uploading {
-			height: 208upx;
-			background-color: pink;
-		}
-		.know {
-			padding: 24upx 33upx;
-			background-color: #fff;
-			.txt-list {
-				font-size: 26upx;
-				color: #232828;
-				margin-bottom: 8upx;
-			}
-		}
-		.btn {
-			width: 100%;
-			height: 98upx;
-			color: #ffffff;
-			font-size: 32upx;
-			text-align: center;
-			line-height: 98upx;
-			background-color: #8064f7;
-			margin-top: 27upx;
-			letter-spacing: 2upx;
-		}
+    .shopicon {
+      height: 100upx;
+      padding: 0 33upx;
+      font-size: 32upx;
+      color: #232828;
+      font-weight: 700;
+      line-height: 100upx;
+    }
+    .iconcontent {
+      padding: 0 33upx;
+      background-color: #f9f9f9;
+      display: flex;
+      align-items: center;
+      height: 200upx;
+      .icon {
+        display: inline-block;
+        width: 156upx;
+        height: 156upx;
+        background-color: #b4b8b7;
+      }
+      .shopLogo {
+        width: 156upx;
+        height:156upx;
+        background-color: green;
+      }
+    }
+    .uploading {
+      height: 208upx;
+      background-color: pink;
+    }
+    .know {
+      padding: 24upx 33upx;
+      background-color: #fff;
+      .txt-list {
+        font-size: 26upx;
+        color: #232828;
+        margin-bottom: 8upx;
+      }
+    }
+    .btn {
+      width: 100%;
+      height: 98upx;
+      color: #ffffff;
+      font-size: 32upx;
+      text-align: center;
+      line-height: 98upx;
+      background-color: #8064f7;
+      margin-top: 27upx;
+      letter-spacing: 2upx;
+    }
   }
 }
 </style>

+ 10 - 0
src/utils/request/request.js

@@ -192,6 +192,16 @@ export default class Request {
     })
   }
 
+  postP (url, params = {}) {
+    const options = {};
+    options.params = params;
+    return this.request({
+      url,
+      method: 'post',
+      ...options
+    })
+  }
+
   post (url, data, options = {}) {
     return this.request({
       url,