ソースを参照

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
新增我的套餐

1004749546@qq.com 4 年 前
コミット
fa803ff447

+ 10 - 6
src/api/request.js

@@ -6,11 +6,15 @@ function request(options) {
   //   title: '加载中' // 数据请求前loading,提高用户体验
   // });
   return new Promise((resolve, reject) => {
-    const baseUrl = 'https://zyyc.chelingzhu.com/zyyc-shop/'; // 预发布
-    // const baseUrl = 'https://shop.qiubcar.com/zyyc-shop/'; // 生产
-    // const baseUrl = 'http://192.168.16.103:7101/zyyc-shop/';
-    // const baseUrl = process.env.NODE_ENV === 'production' ? proUrl : devUrl;
-
+    // 丘比养车服务
+    const baseycUrl = 'https://zyyc.chelingzhu.com/zyyc-shop/'; // 预发布
+    // const baseycUrl = 'https://shop.qiubcar.com/zyyc-shop/'; // 生产
+    // const baseycUrl = 'http://192.168.16.103:7101/zyyc-shop/';
+    // const baseycUrl = process.env.NODE_ENV === 'production' ? proUrl : devUrl;
+    // 丘比车管家服务
+    const qbcgjUrl = 'http://md.test.zyucgj.com/saas/clz/'; // 预发布
+    // const qbcgjUrl = 'https://md.qiubcar.com/saas/clz/'; // 生产
+    // const qbcgjUrl = 'http://192.168.16.102:9110/saas/clz/';
     let _obj = {
       url: '',
       data: {},
@@ -23,7 +27,7 @@ function request(options) {
     Object.assign(_obj, options);
     _obj.header['X-AUTH-TOKEN'] = mpvue.getStorageSync('token');
     _obj.header['X-HEADER-APPID'] = 'qaHKg54DXewQ496T5XR+w9UEf9vNaJoAoTOtDN0LSUM=';
-    _obj.url = baseUrl + _obj.url;
+    _obj.url = (options.isQbcgj ? qbcgjUrl : baseycUrl) + _obj.url;
     _obj.method = _obj.method.toUpperCase();
     _obj.success = function(res) {
       if (res.data.status == 200) {

+ 3 - 1
src/app.json

@@ -40,7 +40,9 @@
     "pages/orderDetail/main",
     "pages/rankingList/main",
     "pages/storeSearch/main",
-    "pages/selectCity/main"
+    "pages/selectCity/main",
+    "pages/myPackage/main",
+    "pages/packageDetail/main"
   ],
   "subpackages": [{
   	"root": "pages/pagesA/",

+ 6 - 0
src/pages/member/index.vue

@@ -18,6 +18,9 @@
         <van-cell size="large" is-link title="我的订单" url="/pages/order/main">
           <van-icon slot="icon" class="title-icon" name="balance-list" />
         </van-cell>
+        <van-cell size="large" is-link title="我的套餐" url="/pages/myPackage/main">
+          <van-icon slot="icon" class="title-icon" name="balance-list" />
+        </van-cell>
         <van-cell size="large" is-link title="联系客服" @click="callPhone">
           <van-icon slot="icon" class="title-icon" name="service" />
         </van-cell>
@@ -126,6 +129,9 @@ export default {
         });
       }
     })
+  },
+  onUnload() {
+     mpvue.setStorageSync('request-qbcgj',false)
   }
 };
 </script>

+ 250 - 0
src/pages/myPackage/index.vue

@@ -0,0 +1,250 @@
+<template>
+    <view class="content">
+      <!-- loading -->
+      <view class="load" v-if="isLoading">
+        <van-loading type="spinner" color="#1989fa">加载中...</van-loading>
+      </view>
+      <scroll-view scroll-y>
+        <van-collapse :value="activeNames" @change="onChange">
+            <van-collapse-item v-for="(item,index) in dataList" :key="index" :title="item.bundleName" :name="index">
+        				<template v-if="item.customerBundleItemList">
+        				      <view class="item-title">
+        				      	<view class="list-item-left ">
+        				       		<text style="font-size: 30rpx;font-weight: 600;">服务</text>
+        				      	</view>
+
+        				      </view>
+        				      	<view  v-for="(items,indexx) in item.customerBundleItemList" :key="indexx"  class="list-item border-bottom-dashed">
+        				      		<view class="list-item-left">
+        				      			<text>{{items.itemName}}</text>
+        				      		</view>
+        				      	    <view class="list-item-right">
+        				      	    	<text>余{{items.itemTimes}}次</text>
+        				      	    </view>
+        				      	</view>
+        				 </template>
+
+
+        				<template v-if="item.customerBundlePartList">
+        					<view class="item-title ">
+        						<view class="list-item-left">
+        					 		<text style="font-size: 30rpx;font-weight: 600;">配件</text>
+        						</view>
+
+        					</view>
+        					<view v-for="(items,indexxx) in item.customerBundlePartList" :key="indexxx"  class="list-item border-bottom-dashed">
+        						<view class="list-item-left">
+        							<text>{{items.partName}}</text>
+        						</view>
+        					    <view class="list-item-right">
+        					    	<text>余{{items.quantity}} {{items.unit?items.unit:''}}</text>
+        					    </view>
+        					</view>
+        				</template>
+        			  <view @click="intoDetail(item)" class="show-detail-box">
+        				   <view class="show-detail">
+        				   	   <text>查看使用明细</text>
+        				   	   <img src="/static/img/show.png" >
+        				   </view>
+
+        			   </view>
+            </van-collapse-item>
+        </van-collapse>
+      </scroll-view>
+		<view  v-if="isLoading && dataList.length ==0 " class="no-data">
+			暂无数据
+		</view>
+
+    </view>
+</template>
+
+<script>
+    export default {
+        components: {
+        },
+        data() {
+            return {
+            activeNames: [],
+            dataList:[{
+              bundleName: 'ceshijh',
+              id: 1,
+              customerBundleItemList: [
+                {
+                  itemName: '111',
+                  itemTimes: 1
+                },
+              ],
+              customerBundlePartList: [
+                {
+                  partName: '111',
+                  quantity: 1
+                },
+               {
+                 partName: '111',
+                 quantity: 1
+               },
+              ]
+            },{
+              bundleName: 'ceshijh',
+              id: 1,
+              customerBundleItemList: [
+                {
+                  itemName: '111',
+                  itemTimes: 1
+                },
+              ],
+              customerBundlePartList: [
+                {
+                  partName: '111',
+                  quantity: 1
+                },
+               {
+                 partName: '111',
+                 quantity: 1
+               },
+              ]
+            }],
+            isLoading:false , //判断页面数据是否请求完全
+          }
+        },
+        methods: {
+          // 进入套餐详情
+          intoDetail(item) {
+            wx.navigateTo({
+              url: '/pages/packageDetail/main?customerBundleId='+item.id +'&bundleName='+item.bundleName
+            })
+          },
+          // 手风琴改变
+          onChange(event) {
+            console.log(event,'eeeeee')
+            this.activeNames = event.mp.detail
+          }
+        },
+        onLoad() {
+
+        },
+        onReady() {
+
+        },
+    }
+</script>
+
+<style lang="stylus" scoped>
+	.content{
+    padding: 15rpx 40rpx;
+    font-size : 14px;
+    background: rgb(245,245,245);
+    height: calc(100vh);
+    overflow: hidden;
+    overflow-y: scroll;
+	}
+	.no-data{
+		font-size: 36rpx;
+		background: rgb(245,245,245);
+		width: 100%;
+		height: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		color: #999;
+	}
+  .load {
+    height: calc(100vh);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+  }
+	.van-collapse:before{
+			position: absolute;
+			z-index: 10;
+			right: 0;
+			top: 0;
+			left: 0;
+			height: 0;
+			content: '';
+			-webkit-transform: scaleY(0.5);
+			transform: scaleY(0.5);
+	}
+  .van-collapse-cell--open{
+  	background: #FFFFFF;
+  }
+  .van-collapse-cell{
+  	font-size: 30rpx;
+  	color: rgb(40,40,40);
+  	border-bottom:20rpx solid rgb(245,245,245);
+  }
+  .van-collapse-cell__title{
+  	font-size: 34rpx;
+  }
+  .van-collapse-cell__title :after {
+  	position: absolute;
+  	z-index: 3;
+  	right: 0;
+  	bottom: 0rpx;
+  	left: 0px;
+  	height:0rpx;
+  	content: '';
+  	-webkit-transform: scaleY(0.5);
+  	transform: scaleY(0.5);
+  	background:rgb(245,245,245) ;
+  }
+  .show-detail-box{
+  	height: 110rpx;
+  	text-align:center;
+  	line-height:110rpx;
+  }
+  .show-detail{
+  		display: flex;
+  		align-items: center;
+  		justify-content: center;
+  		font-size: 28rpx;
+  		color: grb(74,74,74);
+  }
+  .show-detail image{
+  	width: 18rpx;
+  	height: 14rpx;
+  	margin-left: 20rpx;
+  }
+  .list-item-title{
+  	width: 100%;
+  	height: 120rpx;
+  	line-height: 110rpx;
+  }
+  .list-item-left{
+  	margin-left: 30rpx;
+  }
+  .item-title{
+  	margin-top: 20rpx;
+  	width: 100%;
+  	height: 60rpx;
+  	line-height: 60rpx;
+  	font-weight:600;
+    color: rgb(40,40,40);
+  }
+  .border-bottom-solid{
+  	border-bottom: 1px solid rgb(228,228,228);
+  }
+  .border-bottom-dashed{
+  	border-bottom: 1px dashed rgb(228,228,228);
+  }
+  .list-item{
+  	font-size: 28rpx;
+  	width: 90%;
+  	height:110rpx ;
+  	margin-left: 30rpx;
+    color: rgb(40,40,40);
+  	display: flex;
+  	justify-content: space-between;
+  	align-items:center;
+  }
+  .list-item-right{
+  	display: flex;
+  	align-items: center;
+  }
+  .back-img{
+  		width: 16rpx;
+  		height: 22rpx;
+  		margin-left: 20rpx;
+  	}
+</style>

+ 5 - 0
src/pages/myPackage/main.js

@@ -0,0 +1,5 @@
+import Vue from 'vue';
+import App from './index';
+
+const app = new Vue(App);
+app.$mount();

+ 8 - 0
src/pages/myPackage/main.json

@@ -0,0 +1,8 @@
+{
+  "navigationBarTitleText": "我的套餐",
+  "usingComponents": {
+    "van-loading": "../../../static/vant/loading/index",
+    "van-collapse": "../../../static/vant/collapse/index",
+    "van-collapse-item": "../../../static/vant/collapse-item/index"
+  }
+}

+ 183 - 0
src/pages/packageDetail/index.vue

@@ -0,0 +1,183 @@
+<template>
+    <view class="content">
+       <view class="header-cont">
+       	{{bundleName}}
+       </view>
+		<view class="list-container">
+
+			<template v-if="packageData.orderItemList">
+				<view  class="list-item-title border-bottom-solid">
+						<view class="list-item-cont">
+							<view class="name">
+								<text >服务名称</text>
+							</view>
+
+							<view class="num">
+								<text >使用次数</text>
+							</view>
+							<view class="time">
+								<text >使用时间</text>
+							</view>
+						</view>
+
+				</view>
+
+				<view class="list-item " v-for="(item,index) in packageData.orderItemList" :key="index">
+					<view class="list-item-cont" :class="index != (packageData.orderItemList.length-1) ?'border-bottom-dashed':'' ">
+						<view class="name">
+							<text>{{item.itemName}}</text>
+						</view>
+						<view class="num">
+							<text >{{item.time}}次</text>
+						</view>
+						<text class="time">{{item.orderDate}}</text>
+					</view>
+
+				</view>
+				<!-- 分割区域 -->
+				<view v-if="packageData.orderPartList" class="list-br">
+
+				</view>
+			</template>
+
+			<template v-if="packageData.orderPartList">
+				<view  class="list-item-title border-bottom-solid">
+						<view class="list-item-cont">
+							<view class="name">
+								<text >配件名称</text>
+							</view>
+
+							<view class="num">
+								<text >使用数量</text>
+							</view>
+							<view class="time">
+								<text >使用时间</text>
+							</view>
+						</view>
+
+				</view>
+
+				<view class="list-item " v-for="(item,index) in packageData.orderPartList" :key="index">
+					<view class="list-item-cont " :class="index != (packageData.orderPartList.length-1) ?'border-bottom-dashed':'' ">
+						<view class="name">
+							<text>{{item.partName}}</text>
+						</view>
+						<view class="num">
+							<text >{{item.quantity}} {{item.unit?item.unit:''}}</text>
+						</view>
+						<text class="time">{{item.orderDate}}</text>
+					</view>
+
+				</view>
+			</template>
+
+		</view>
+		<view  v-if="!packageData.orderItemList && !packageData.orderPartList" class="no-data">
+			暂无数据
+		</view>
+    </view>
+</template>
+
+<script>
+    export default {
+        components: {
+        },
+        data() {
+            return {
+            bundleName:'', //套餐名称
+            packageData: {},
+          }
+        },
+        methods: {
+
+        },
+        onLoad:function(option){
+        },
+        onReady() {
+
+        }
+    }
+</script>
+
+<style lang="stylus" scoped>
+	.content{
+		padding:0 20rpx;
+		background: rgb(245,245,245);
+		color: rgb(40,40,40);
+		font-size: 30rpx;
+	}
+	.header-cont{
+		height: 110rpx;
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		border-radius: 10rpx;
+		text-align: center;
+		line-height: 110rpx;
+		font-weight: 600;
+		font-size: 32rpx;
+
+	}
+	.no-data{
+		font-size: 36rpx;
+		background: rgb(245,245,245);
+		width: 100%;
+		text-align: center;
+		line-height: 600rpx;
+		color: #999;
+
+	}
+	.list-container{
+		width: 100%;
+		background-color: #fff;
+		display:flex;
+		flex-direction:column;
+		align-items:center;
+		border-radius:10rpx;
+		font-size: 30rpx;
+	}
+  .list-br{
+  	height: 20rpx;
+  	width: 100%;
+  	background: rgb(245,245,245);
+  	margin: 10rpx 0;
+  }
+  .list-item-title{
+  	width: 100%;
+  	padding:0 30rpx;
+  	box-sizing:border-box;
+  }
+  .list-item-cont{
+  	padding: 30rpx 0;
+  	display: flex;
+  	align-items: center;
+  	justify-content: space-between;
+  }
+  .name{
+  	width: 40%;
+  }
+  .num{
+  	width: 30%;
+  	text-align: center;
+  }
+  .time{
+  	width: 30%;
+  	text-align: right;
+  }
+
+  .border-bottom-solid{
+  	border-bottom: 1px solid rgb(228,228,228);
+
+  }
+  .border-bottom-dashed{
+  	border-bottom: 1px dashed rgb(228,228,228);
+
+  }
+  .list-item{
+  	width: 100%;
+    padding:0 30rpx;
+    box-sizing:border-box;
+  	font-size: 26rpx;
+  }
+
+
+</style>

+ 12 - 0
src/pages/packageDetail/main.js

@@ -0,0 +1,12 @@
+import Vue from 'vue';
+import App from './index';
+
+// add this to handle exception
+// Vue.config.errorHandler = function (err) {
+//   if (console && console.error) {
+//     console.error(err)
+//   }
+// }
+
+const app = new Vue(App);
+app.$mount();

+ 3 - 0
src/pages/packageDetail/main.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "套餐使用明细"
+}

BIN
static/img/show.png