panhui %!s(int64=6) %!d(string=hai) anos
pai
achega
8f13a38bdb

+ 11 - 46
project.config.json

@@ -33,7 +33,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 9,
+			"current": 4,
 			"list": [
 				{
 					"id": 0,
@@ -44,44 +44,9 @@
 				},
 				{
 					"id": 1,
-					"name": "设置",
-					"pathName": "pages/setting/setting",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 2,
-					"name": "摄影师详情",
-					"pathName": "pages/caseDetail/caseDetail",
-					"query": "id=1",
-					"scene": null
-				},
-				{
-					"id": 3,
-					"name": "购物车",
-					"pathName": "pages/shoppingCart/shoppingCart",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 4,
-					"name": "摄影师详情",
-					"pathName": "pages/submit/submit",
-					"query": "submitPage=shoppingCart&chooseList=9,5",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "搜索",
-					"pathName": "pages/search/search",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "搜索",
-					"pathName": "pages/successPage/successPage",
-					"query": "pageType=paySuccess",
+					"name": "预约时间",
+					"pathName": "pages/bookingTime/bookingTime",
+					"query": "orderId=21",
 					"scene": null
 				},
 				{
@@ -93,16 +58,16 @@
 				},
 				{
 					"id": -1,
-					"name": "评价",
-					"pathName": "pages/evaluate/evaluate",
-					"query": "orderId=19",
+					"name": "私人定制",
+					"pathName": "pages/customize/customize",
+					"query": "",
 					"scene": null
 				},
 				{
-					"id": 9,
-					"name": "订单详情",
-					"pathName": "pages/orderDetail/orderDetail",
-					"query": "orderId=26&index=3",
+					"id": -1,
+					"name": "定制下单",
+					"pathName": "pages/submit/submit",
+					"query": "submitPage=customize&serviceList=2,3,6,7,8,9",
 					"scene": null
 				}
 			]

+ 15 - 1
src/App.vue

@@ -1,12 +1,18 @@
 <script>
 export default {
-    onLaunch() {
+    onLaunch(options) {
         wx.getSystemInfo({
             success: res => {
                 this.$store.commit('updateSysInfo', res);
             },
         });
         try {
+
+            // this.$store.commit('updateOpenInfo',options)
+            // wx.reLaunch({
+            //     url: '/pages/login/login',
+            // });
+            // return;
             var token = wx.getStorageSync('token');
             console.log(token);
             if (token) {
@@ -17,6 +23,10 @@ export default {
                     .then(res => {
                         if (res.success) {
                             this.$store.commit('updateUserInfo', res.data);
+                        } else if ((res.code = 10001)) {
+                            wx.reLaunch({
+                                url: '/pages/login/login',
+                            });
                         }
                     })
                     .catch(e => {
@@ -98,4 +108,8 @@ page {
         background-color: #00c5f2;
     }
 }
+
+ button::after {
+    border: 0;
+  }
 </style>

+ 3 - 1
src/app.json

@@ -20,7 +20,9 @@
         "pages/changeUser/changeUser",
         "pages/orderList/orderList",
         "pages/evaluate/evaluate",
-        "pages/orderDetail/orderDetail"
+        "pages/orderDetail/orderDetail",
+        "pages/bookingTime/bookingTime",
+        "pages/customize/customize"
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 1 - 4
src/calc.js

@@ -6,8 +6,7 @@
     返回值:两数相加的结果
     */
 exports.Add = function(arg1, arg2) {
-    console.log(arg1, arg2);
-    if (arg1 && arg2) {
+    if ((arg1 && arg2) || arg1 == 0 || arg2 == 0) {
         (arg1 = arg1.toString()), (arg2 = arg2.toString());
         var arg1Arr = arg1.split('.'),
             arg2Arr = arg2.split('.'),
@@ -17,8 +16,6 @@ exports.Add = function(arg1, arg2) {
         var m = Math.pow(10, maxLen);
         var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen));
         var d = arguments[2];
-        console.log(d);
-        console.log(result);
         return typeof d === 'number' ? Number(result.toFixed(d)) : result;
     }
 };

+ 82 - 0
src/components/ActionSheet.vue

@@ -0,0 +1,82 @@
+<template>
+    <div class='box weui-animate-fade-in' v-if="visible" @click="close('close')">
+        <div class="sheet weui-animate-slide-up" @click.stop="">
+            <div class="sheet-item" v-for="(item,index) in list" @click="close(item.id)" :key="index">
+                {{label?item[label]:item}}
+            </div>
+            <div class="line"></div>
+            <div class="sheet-item" @click="close('close')">
+                取消
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+export default {
+    name: 'actionSheet',
+    props: {
+        list: {
+            type: Array,
+            default: () => {
+                return [];
+            },
+        },
+        label: {
+            type: String,
+            default: '',
+        },
+        visible: {
+            type: Boolean,
+            default: false,
+        },
+    },
+    data() {
+        return {};
+    },
+    computed: {
+        ...mapState(['userInfo']),
+    },
+    methods: {
+        close(value) {
+            this.$emit('close', value);
+        },
+    },
+};
+</script>
+<style lang='less' scoped>
+.box {
+    position: fixed;
+    z-index: 500;
+    background-color: rgba(0, 0, 0, 0.5);
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.sheet {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    background-color: #fff;
+    width: 100%;
+    .sheet-item {
+        font-size: 14px;
+        color: #555;
+        height: 50px;
+        line-height: 50px;
+        background-color: #fff;
+        text-align: center;
+        border-bottom: 1px solid #f2f4f5;
+        &:active {
+            background-color: darken(#fff, 10);
+        }
+    }
+
+    .line {
+        height: 10px;
+        background-color: #f2f4f5;
+    }
+}
+</style>

+ 129 - 0
src/components/CustomizeDetail.vue

@@ -0,0 +1,129 @@
+<template>
+    <div class='box weui-animate-fade-in' v-if="visible" @click="close()">
+        <div class="sheet weui-animate-slide-up" @click.stop="">
+            <div class="sheetTitle">套餐详情</div>
+
+            <div class="content" v-if="list.length">
+                <div class="title">选择服务</div>
+                <div class="item" v-for="(item,index) in list" :key="index">
+                    <div class="name">{{item.serviceName}}</div>
+                    <div class="price">{{item.price||0}}</div>
+                </div>
+            </div>
+
+            <div class="content">
+                <div class="title">必选服务</div>
+                <div class="item" v-for="(item,index) in mandatory" :key="index">
+                    <div class="name">{{item.serviceName}}</div>
+                    <div class="price">{{item.price||0}}</div>
+                </div>
+            </div>
+
+            <img class="closeImg" src="/static/images/icon_tanchuangclose_02.png" @click="close()" alt="">
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+export default {
+    name: 'actionSheet',
+    props: {
+        list: {
+            type: Array,
+            default: () => {
+                return {};
+            },
+        },
+        mandatory: {
+            type: Array,
+            default: () => {
+                return {};
+            },
+        },
+        visible: {
+            type: Boolean,
+            default: false,
+        },
+    },
+    data() {
+        return {};
+    },
+    computed: {
+        ...mapState(['userInfo']),
+    },
+    methods: {
+        close() {
+            this.$emit('close');
+        },
+    },
+};
+</script>
+<style lang='less' scoped>
+.box {
+    position: fixed;
+    z-index: 500;
+    background-color: rgba(0, 0, 0, 0.5);
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.sheet {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    background-color: #fafafa;
+    border-radius: 8px 8px 0px 0px;
+    width: 100%;
+    max-height: 70%;
+    overflow-y: scroll;
+    padding: 0 15px;
+    box-sizing: border-box;
+
+    .sheetTitle {
+        font-size: 18px;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+        line-height: 55px;
+        text-align: center;
+    }
+    .content {
+        border-top: 1px solid #f2f4f5;
+        padding: 0 0 12px;
+        .title {
+            font-size: 14px;
+            font-weight: bold;
+            color: rgba(0, 0, 0, 1);
+            line-height: 20px;
+            padding: 15px 0 10px;
+        }
+        .item {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            line-height: 24px;
+
+            .name {
+                font-size: 14px;
+                color: rgba(153, 153, 153, 1);
+                line-height: 24px;
+            }
+
+            .price {
+                font-size: 14px;
+                color: rgba(255, 59, 48, 1);
+                line-height: 24px;
+            }
+        }
+    }
+}
+
+.closeImg {
+    width: 26px;
+    height: 26px;
+    position: absolute;
+    top: 11px;
+    right: 7px;
+}
+</style>

+ 120 - 0
src/components/CustomizeItem.vue

@@ -0,0 +1,120 @@
+<template>
+    <div class='service' :class="{select:isChoose}" @click="chooseSelect(id)">
+        <div @click.stop='goDetail'>
+            <img v-if="image" :src="image+'?x-oss-process=image/resize,m_fill,h_81,w_109'" class="bgImg" background-size="cover" alt="">
+            <img class="bgImg" v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+        </div>
+        <div class="name">{{name}}</div>
+
+        <button>{{isChoose?'已选择Ta':'选择Ta'}}</button>
+
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+export default {
+    name: '',
+    props: {
+        image: {
+            type: String,
+            default: '',
+        },
+        name: {
+            type: String,
+            default: '',
+        },
+        isChoose: {
+            type: Boolean,
+            default: false,
+        },
+        id: {
+            type: Number,
+            default: 0,
+        },
+        type: {
+            type: String,
+            default: '',
+        },
+    },
+    data() {
+        return {};
+    },
+    computed: {
+        ...mapState(['userInfo']),
+    },
+    methods: {
+        chooseSelect(id) {
+            this.$emit('chooseSelect', {
+                id: id,
+                type: this.type,
+            });
+        },
+        goDetail() {
+            wx.navigateTo({
+                url: '/pages/serviceDetail/serviceDetail?id=' + this.id,
+            });
+        },
+    },
+};
+</script>
+<style lang='less' scoped>
+.service {
+    width: 106px;
+    height: 160px;
+    background: rgba(255, 255, 255, 1);
+    border-radius: 4px;
+    padding: 15px;
+    box-sizing: border-box;
+    margin-bottom: 14px;
+    display: inline-block;
+    margin-right: 14px;
+    border: 1px solid #fff;
+
+    .bgImg {
+        width: 76px;
+        height: 76px;
+        border-radius: 2px;
+        display: block;
+    }
+
+    .name {
+        font-size: 14px;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+        line-height: 20px;
+        text-align: center;
+        margin: 5px 0 8px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
+    button {
+        width: 76px;
+        height: 24px;
+        border-radius: 2px;
+        border: 1px solid rgba(0, 197, 242, 1);
+        font-size: 11px;
+        color: rgba(0, 197, 242, 1);
+        line-height: 24px;
+        background-color: #fff;
+
+        &:active {
+            background-color: darken(#fff, 10);
+        }
+    }
+
+    &.select {
+        border: 1px solid rgba(0, 197, 242, 1);
+        background: rgba(0, 197, 242, 0.1);
+
+        .name {
+            color: #00c5f2;
+        }
+
+        button {
+            background: rgba(0, 197, 242, 1);
+            color: #ffffff;
+        }
+    }
+}
+</style>

+ 130 - 0
src/components/CustomizeOrderDetail.vue

@@ -0,0 +1,130 @@
+<template>
+    <div class='box weui-animate-fade-in' v-if="visible" @click="close()">
+        <div class="sheet weui-animate-slide-up" @click.stop="">
+            <div class="sheetTitle">套餐详情</div>
+
+            <div class="content" v-if="list.length">
+                <div class="title">服务内容</div>
+                <div class="item" v-for="(item,index) in list" :key="index">
+                    <div class="name">{{item.serviceName}}</div>
+                    <div class="price">{{item.price||0}}</div>
+                </div>
+            </div>
+
+            <button @click="close()">确定</button>
+
+            <img class="closeImg" src="/static/images/icon_tanchuangclose_02.png" @click="close()" alt="">
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+export default {
+    name: 'customizeOrderDetail',
+    props: {
+        list: {
+            type: Array,
+            default: () => {
+                return {};
+            },
+        },
+        visible: {
+            type: Boolean,
+            default: false,
+        },
+    },
+    data() {
+        return {};
+    },
+    computed: {
+        ...mapState(['userInfo']),
+    },
+    methods: {
+        close() {
+            this.$emit('close');
+        },
+    },
+};
+</script>
+<style lang='less' scoped>
+.box {
+    position: fixed;
+    z-index: 500;
+    background-color: rgba(0, 0, 0, 0.5);
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.sheet {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    background-color: #ffffff;
+    border-radius: 8px 8px 0px 0px;
+    width: 100%;
+    max-height: 70%;
+    overflow-y: scroll;
+    padding: 0 15px;
+    box-sizing: border-box;
+
+    .sheetTitle {
+        font-size: 18px;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+        line-height: 55px;
+        text-align: center;
+    }
+    .content {
+        border-top: 1px solid #f2f4f5;
+        border-bottom: 1px solid #f2f4f5;
+        padding: 0 0 12px;
+        .title {
+            font-size: 14px;
+            font-weight: bold;
+            color: rgba(0, 0, 0, 1);
+            line-height: 20px;
+            padding: 15px 0 10px;
+        }
+        .item {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            line-height: 24px;
+
+            .name {
+                font-size: 14px;
+                color: rgba(153, 153, 153, 1);
+                line-height: 24px;
+            }
+
+            .price {
+                font-size: 14px;
+                color: rgba(255, 59, 48, 1);
+                line-height: 24px;
+            }
+        }
+    }
+}
+
+.closeImg {
+    width: 26px;
+    height: 26px;
+    position: absolute;
+    top: 11px;
+    right: 7px;
+}
+
+button {
+    width: 100%;
+    height: 40px;
+    background: rgba(0, 197, 242, 1);
+    border-radius: 22px;
+    font-size: 15px;
+    font-weight: bold;
+    color: rgba(255, 255, 255, 1);
+    line-height: 40px;
+    margin: 27px 0 8px;
+}
+</style>

+ 8 - 3
src/components/MenuList.vue

@@ -1,9 +1,9 @@
 <template>
     <div class="menuList">
-        <!-- <div class="menu-item">
+        <div class="menu-item" @click="goCustomize">
             <img src="/static/images/home_icon_shiren.png" alt="">
             <div>私人定制</div>
-        </div> -->
+        </div>
 
         <div class="menu-item">
             <img src="/static/images/home_icon_zaixian.png" alt="">
@@ -38,6 +38,11 @@ export default {
                 phoneNumber: this.storeInfo.telephone, //仅为示例,并非真实的电话号码
             });
         },
+        goCustomize() {
+            wx.navigateTo({
+                url: '/pages/customize/customize',
+            });
+        },
     },
 };
 </script>
@@ -45,7 +50,7 @@ export default {
 .menuList {
     display: flex;
     padding: 50rpx;
-    justify-content: space-around;
+    justify-content: space-between;
 
     .menu-item {
         display: flex;

+ 100 - 34
src/components/OrderItem.vue

@@ -1,18 +1,24 @@
 <template>
     <div class='order'>
         <div class="orderTop">
-            <span>{{info.statusFlag==0?'支付单号:':'订单号:'}}{{info.orderCode}}</span>
+            <span>订单号:{{info.orderCode}}</span>
 
             <span>{{statusName}}</span>
         </div>
         <div @click="goDetail" class="orderInfo" v-for="(item,index) in productList" :key="index">
-            <img class="image" v-if="item.productInfo.image" :src="item.productInfo.image+'?x-oss-process=image/resize,m_fill,h_120,w_120'" background-size="cover" alt="">
-            <img class="image" v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+            <block v-if="item.productInfo">
+                <img class="image" v-if="item.productInfo.image" :src="item.productInfo.image+'?x-oss-process=image/resize,m_fill,h_120,w_120'" background-size="cover" alt="">
+                <img class="image" v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+            </block>
+            <block v-else>
+                <img class="image" src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+
+            </block>
             <div class="content">
-                <div class="title">{{item.productInfo.title}}</div>
+                <div class="title">{{item.productName}}</div>
                 <div class="sub">{{item.typeFlag==0?"全款支付":"定金支付"}}</div>
                 <div class="moeny">
-                    <span class="price">{{item.typeFlag==0?item.productInfo.price:item.productInfo.downPayment}}</span>
+                    <span class="price">{{item.unitPrice}}</span>
                     <span class="num">{{item.quantity}}</span>
                 </div>
             </div>
@@ -26,11 +32,11 @@
         <div class="btnList">
             <div class="btn-item" v-for="(item,index) in btnList" :key="index">
                 <button :class="[item.type]" :open-type='item.openType' @click="clickEvent(item.name)">{{item.name}}</button>
-                <picker class="picker" v-if="item.name=='立即预约'" mode="date" :start="nowDate" @change="bindDateChange">
+                <!-- <picker class="picker" v-if="item.name=='立即预约'" mode="date" :start="nowDate" @change="bindDateChange">
                     <view class="picker">
                         当前选择: {{date}}
                     </view>
-                </picker>
+                </picker> -->
             </div>
         </div>
     </div>
@@ -55,6 +61,12 @@ export default {
             type: String,
             default: '',
         },
+        userOrder: {
+            type: Object,
+            default: () => {
+                return {};
+            },
+        },
     },
     computed: {
         ...mapState(['userInfo']),
@@ -233,38 +245,86 @@ export default {
     },
     methods: {
         goDetail() {
-            if (this.statusName == '待支付') {
-                wx.navigateTo({
-                    url: '/pages/submit/submit?orderId=' + this.info.id,
-                });
-            } else {
-                wx.navigateTo({
-                    url:
-                        '/pages/orderDetail/orderDetail?orderId=' +
-                        this.info.id +
-                        '&index=' +
-                        (this.orderIndex || this.index),
-                });
-            }
+            // if (this.statusName == '待支付') {
+            //     wx.navigateTo({
+            //         url: '/pages/submit/submit?orderId=' + this.info.id,
+            //     });
+            // } else {
+            wx.navigateTo({
+                url:
+                    '/pages/orderDetail/orderDetail?orderId=' +
+                    this.info.id +
+                    '&index=' +
+                    (this.orderIndex || this.index) +
+                    '&userOrderId=' +
+                    (this.info.statusFlag == OrderStatus.NOPAY
+                        ? this.userOrder.id
+                        : ''),
+            });
+            // }
         },
         clickEvent(name) {
             if (name == '立即支付') {
-                wx.navigateTo({
-                    url: '/pages/submit/submit?orderId=' + this.info.id,
-                });
+                if (this.userOrder.userOrderDetailList.length > 1) {
+                    var orderList = this.userOrder.userOrderDetailList.map(
+                        item => {
+                            return item.orderCode;
+                        },
+                    );
+                    var ref = this;
+                    wx.showModal({
+                        title: '该订单和其他订单同时下单',
+                        content: orderList.join(',\r\n ') + '\r\n需要合并付款',
+                        confirmColor: '#00C5F2',
+                        confirmText: '合并付款',
+                        success(res) {
+                            if (res.confirm) {
+                                wx.navigateTo({
+                                    url:
+                                        '/pages/submit/submit?orderId=' +
+                                        ref.userOrder.id,
+                                });
+                            } else if (res.cancel) {
+                            }
+                        },
+                    });
+                } else {
+                    wx.navigateTo({
+                        url:
+                            '/pages/submit/submit?orderId=' + this.userOrder.id,
+                    });
+                }
             } else if (name == '取消订单') {
-                var ref = this;
-                wx.showModal({
-                    title: '提示',
-                    content: '确定要取消该订单吗?',
-                    confirmColor: '#00C5F2',
-                    success(res) {
-                        if (res.confirm) {
-                            ref.$emit('cancelOrder');
-                        } else if (res.cancel) {
-                        }
-                    },
+                var orderList = this.userOrder.userOrderDetailList.map(item => {
+                    return item.orderCode;
                 });
+                var ref = this;
+                if (this.userOrder.userOrderDetailList.length > 1) {
+                    wx.showModal({
+                        title: '该订单和其他订单同时下单',
+                        content: orderList.join(',\r\n ') + '\r\n需要一起取消',
+                        confirmColor: '#00C5F2',
+                        confirmText: '一起取消',
+                        success(res) {
+                            if (res.confirm) {
+                                ref.$emit('cancelOrder');
+                            } else if (res.cancel) {
+                            }
+                        },
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: '确定要取消该订单吗?',
+                        confirmColor: '#00C5F2',
+                        success(res) {
+                            if (res.confirm) {
+                                ref.$emit('cancelOrder');
+                            } else if (res.cancel) {
+                            }
+                        },
+                    });
+                }
             } else if (name == '立即评价') {
                 wx.navigateTo({
                     url:
@@ -275,6 +335,12 @@ export default {
                 });
             } else if (name == '查看订单') {
                 this.goDetail();
+            } else if (name == '立即预约') {
+                wx.navigateTo({
+                    url:
+                        '/pages/bookingTime/bookingTime?orderId=' +
+                        this.info.id,
+                });
             }
         },
         bindDateChange(e) {

+ 8 - 1
src/components/ShoppingCart.vue

@@ -9,7 +9,7 @@
         <img @click="choose" class="productImg" v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
 
         <div class="content">
-            <div class="title">{{productInfo.title}}</div>
+            <div class="title" @click="goDetail">{{productInfo.title}}</div>
 
             <div class="lable" @click="showSpecifications=true">
                 <span>{{info.typeFlag==0?'全款支付':'定金支付'}}</span>
@@ -102,6 +102,13 @@ export default {
         this.chooseType = this.info.typeFlag == 0 ? 'all' : 'down';
     },
     methods: {
+        goDetail(){
+              wx.navigateTo({
+                        url:
+                            '/pages/product/product?id=' +
+                            this.info.productId,
+                    });
+        },
         addNum() {
             this.updateCart(Number(this.num) + 1);
         },

+ 12 - 4
src/components/SpecificationsContent.vue

@@ -21,10 +21,10 @@
                     购买数量
                 </div>
                 <div class="numVal">
-                    <img v-if="num>1" @click="subNum" src="/static/images/icon_jianqu.png" alt="">
+                    <img v-if="num>1&&!disabled" @click="subNum" src="/static/images/icon_jianqu.png" alt="">
                     <img v-else src="/static/images/icon_jianqu_dis.png" alt="">
-                    <input type="number" v-model="num" confirm-type='done' @input="checkNum" />
-                    <img v-if="num<100" @click="addNum" src="/static/images/icon_zengjia.png" alt="">
+                    <input type="number" v-model="num" :disabled='disabled' confirm-type='done' @input="checkNum" />
+                    <img v-if="num<100&&!disabled" @click="addNum" src="/static/images/icon_zengjia.png" alt="">
                     <img v-else src="/static/images/icon_zengjia_dis.png" alt="">
                 </div>
             </div>
@@ -63,6 +63,10 @@ export default {
             type: Number,
             default: 1,
         },
+        type:{
+            type:String,
+            default:''
+        }
     },
     data() {
         return {
@@ -108,7 +112,11 @@ export default {
             this.$emit('changeType', type);
         },
     },
-    computed: {},
+    computed: {
+        disabled(){
+            return this.type=='customize'
+        }
+    },
 };
 </script>
 <style lang='less' scoped>

+ 49 - 6
src/components/SubOrder.vue

@@ -1,14 +1,20 @@
 <template>
     <div class='order'>
         <div class="orderInfo" v-for="(item,index) in list" :key="index">
-            <img class="image" v-if="item.productInfo.image" :src="item.productInfo.image+'?x-oss-process=image/resize,m_fill,h_120,w_120'" background-size="cover" alt="">
-            <img class="image" v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+            <block v-if="item.productInfo">
+                <img class="image" @click='goDetail' v-if="item.productInfo.image" :src="item.productInfo.image+'?x-oss-process=image/resize,m_fill,h_120,w_120'" background-size="cover" alt="">
+                <img class="image" @click='goDetail' v-else src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+            </block>
+            <block v-else>
+                <img class="image" @click='goDetail' src="/static/images/icon_sirendingzhi.png" background-size="cover" alt="">
+
+            </block>
             <div class="content">
-                <div class="title">{{item.productInfo.title}}</div>
+                <div class="title">{{type!='submit'?item.productName:item.productInfo.title}}</div>
                 <div class="sub">{{item.typeFlag==0?"全款支付":"定金支付"}}</div>
                 <div class="moeny">
-                    <span class="price">{{item.typeFlag==0?item.productInfo.price:item.productInfo.downPayment}}</span>
-                    <span class="num">{{item.quantity}}</span>
+                    <span class="price">{{type!='submit'?item.unitPrice:(item.typeFlag==0?item.productInfo.price:item.productInfo.downPayment)}}</span>
+                    <span class="num" v-if="item.quantity">{{item.quantity}}</span>
                 </div>
             </div>
         </div>
@@ -34,9 +40,12 @@
             <span>小计:</span>
             <span class="price">{{productMoney}}</span>
         </div>
+        <customizeOrderDetail :list='serviceList' :visible='showDetail' @close="showDetail=false"></customizeOrderDetail>
+
     </div>
 </template>
 <script>
+import customizeOrderDetail from './CustomizeOrderDetail';
 export default {
     name: 'subOrder',
     props: {
@@ -58,13 +67,47 @@ export default {
     data() {
         return {
             message: '',
+            showDetail: false,
         };
     },
+    onLoad() {
+        this.showDetail = false;
+    },
+    computed: {
+        serviceList() {
+            var list = [];
+            if (this.list.length > 0) {
+                var allList = this.list[0].orderServiceList || [];
+                list = allList.map(item => {
+                    return item.storeService;
+                });
+            }
+            return list;
+        },
+    },
     watch: {
         message() {
             this.$emit('changeMessage', this.message);
         },
     },
+    methods: {
+        goDetail() {
+            if (this.type == 'order') {
+                if (this.list[0].tailorFlag == 'Y') {
+                    this.showDetail = true;
+                } else {
+                    wx.navigateTo({
+                        url:
+                            '/pages/product/product?id=' +
+                            this.list[0].productId,
+                    });
+                }
+            }
+        },
+    },
+    components: {
+        customizeOrderDetail,
+    },
 };
 </script>
 <style lang='less' scoped>
@@ -148,7 +191,7 @@ export default {
         flex-grow: 1;
         text-align: right;
 
-        &.notSet{
+        &.notSet {
             color: #999;
         }
     }

+ 10 - 11
src/components/UserOrderItem.vue

@@ -1,6 +1,6 @@
 <template>
     <div class='userOrder'>
-        <orderItem v-for="(item,itemIndex) in userOrderDetailList" :orderIndex='index' :index='itemIndex' @update='update' @cancelOrder='cancelOrder' :key="itemIndex" :info='item'></orderItem>
+        <orderItem v-for="(item,itemIndex) in userOrderDetailList" :userOrder='info' :orderIndex='index' :index='itemIndex' @update='update' @cancelOrder='cancelOrder' :key="itemIndex" :info='item'></orderItem>
     </div>
 </template>
 <script>
@@ -29,16 +29,15 @@ export default {
         userOrderDetailList() {
             var list = [];
             var allList = [...this.info.userOrderDetailList];
-            if (this.info.statusFlag != 0) {
-                list = allList;
-            } else if (allList.length > 0) {
-                var jsonp = { ...this.info };
-                jsonp.productList = [];
-                allList.forEach(item => {
-                    jsonp.productList.push(item);
-                });
-                list.push(jsonp);
-            }
+            list = allList;
+            // else if (allList.length > 0) {
+            //     var jsonp = { ...this.info };
+            //     jsonp.productList = [];
+            //     allList.forEach(item => {
+            //         jsonp.productList.push(item);
+            //     });
+            //     list.push(jsonp);
+            // }
             return list;
         },
     },

+ 5 - 0
src/pages/bookingTime/bookingTime.js

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

+ 3 - 0
src/pages/bookingTime/bookingTime.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "预约时间"
+}

+ 409 - 0
src/pages/bookingTime/bookingTime.vue

@@ -0,0 +1,409 @@
+<template>
+    <div class='container'>
+        <div class="top">
+            <span>{{topTime}}</span>
+
+            <img src="/static/images/goPre.png" alt="" v-if="!isNow" @click="goPre" class="left">
+            <img src="/static/images/icon_inter.png" alt="" @click="goNext" class="right">
+        </div>
+        <div class="calendar">
+            <div class="week">
+                <span v-for="(item,index) in weekList" :key='index'>{{item}}</span>
+            </div>
+
+            <div class="dayList">
+                <span v-for="(item,index) in dayList" :class="[item.class,item.day==chooseDay&&chooseDay?'select':'']" :key='index' @click="choose(item)">{{item.day}}</span>
+            </div>
+        </div>
+
+        <div class="chooseTime">
+            <div class="chooseContent">
+                <div class="chooseTop">选择时间</div>
+                <div class="chooseLableList">
+                    <div class="chooseLable" v-for="(item,index) in timeList" :class="{select:item==chooseTime}" :key="index" @click="chooseTime=item">{{item}}</div>
+                </div>
+            </div>
+        </div>
+
+        <div class="bottomFixed">
+            <button @click="submit">确定</button>
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import { OrderStatus } from '../../Constants';
+export default {
+    name: 'bookingTime',
+    data() {
+        return {
+            nowTime: '',
+            topTime: '',
+            weekList: ['一', '二', '三', '四', '五', '六', '日'],
+            dayList: [],
+            chooseDay: 0,
+            isNow: true,
+            year: '',
+            month: '',
+            timeList: [
+                '09:00',
+                '10:00',
+                '11:00',
+                '12:00',
+                '13:00',
+                '14:00',
+                '15:00',
+                '16:00',
+                '17:00',
+            ],
+            chooseTime: '',
+            orderId: '',
+            orderInfo: {},
+        };
+    },
+    computed: {
+        ...mapState(['userInfo']),
+        chooseInfo() {
+            return (
+                this.year +
+                '/' +
+                this.formatNumber(this.month) +
+                '/' +
+                this.formatNumber(this.chooseDay) +
+                ' ' +
+                this.chooseTime +
+                ':00'
+            );
+        },
+    },
+    onLoad(options) {
+        console.log(options);
+        this.orderId = options.orderId;
+        this.chooseTime = '';
+        var date = new Date();
+        var year = date.getFullYear();
+        var month = date.getMonth() + 1;
+        this.chooseDay = date.getDate() + 2;
+        this.getCalendar(year, month);
+        this.$http
+            .get('/userOrderDetail/getOne', {
+                id: this.orderId,
+            })
+            .then(res => {
+                if (res.success) {
+                    if (
+                        res.data.statusFlag != OrderStatus.PAYOVER &&
+                        res.data.statusFlag != OrderStatus.PHOTOOVER &&
+                        res.data.statusFlag != OrderStatus.SELECTOVER &&
+                        res.data.statusFlag != OrderStatus.CHECKOVER
+                    ) {
+                        wx.showModal({
+                            title: '提示',
+                            content: '当前订单已经不是预约状态',
+                            confirmColor: '#00C5F2',
+                            showCancel: false,
+                            success(res) {
+                                wx.navigateTo();
+                            },
+                        });
+                    }
+
+                    this.orderInfo = res.data;
+                }
+            });
+    },
+    methods: {
+        choose(dayInfo) {
+            if (!dayInfo.class && dayInfo.day) {
+                this.chooseDay = dayInfo.day;
+            }
+        },
+        getCalendar(year, month) {
+            this.year = year;
+            this.month = month;
+            this.isNow = false;
+            if (
+                year == new Date().getFullYear() &&
+                month == new Date().getMonth() + 1
+            ) {
+                this.isNow = true;
+            }
+            var nowDay = new Date().getDate();
+
+            this.topTime = year + '年' + this.formatNumber(month) + '月';
+
+            var firstDate = new Date(
+                year + '/' + this.formatNumber(month) + '/01',
+            );
+            var lastDate = this.getMonthLastDate(year, month);
+            console.log(firstDate.getDay());
+            console.log(lastDate);
+            var dayList = [];
+            var firstDay = firstDate.getDay() == 0 ? 7 : firstDate.getDay();
+            console.log(firstDay);
+            //星期前面的塞空
+            for (var i = 1; i < firstDay; i++) {
+                dayList.push({
+                    day: '',
+                });
+            }
+            for (var i = firstDate.getDate(); i <= lastDate.getDate(); i++) {
+                if (this.isNow) {
+                    if (i < nowDay) {
+                        dayList.push({
+                            class: 'not',
+                            day: i,
+                        });
+                        if (this.chooseDay == i) {
+                            this.chooseDay = new Date().getDate() + 2;
+                        }
+                    } else if (i == nowDay) {
+                        dayList.push({
+                            class: 'now',
+                            day: i,
+                        });
+                    } else {
+                        dayList.push({
+                            day: i,
+                        });
+                    }
+                } else {
+                    dayList.push({
+                        day: i,
+                    });
+                }
+            }
+            this.dayList = dayList;
+        },
+        getMonthLastDate(year, month) {
+            var date1;
+            if (month == 12) {
+                date1 = new Date(
+                    year + 1 + '/' + this.formatNumber(month - 11) + '/01',
+                ); //获取下个月的第一天
+            } else {
+                date1 = new Date(
+                    year + '/' + this.formatNumber(month + 1) + '/01',
+                ); //获取下个月的第一天
+            }
+            return new Date(Date.parse(date1) - 86400000);
+        },
+        formatNumber(n) {
+            const str = n.toString();
+            return str[1] ? str : `0${str}`;
+        },
+        goNext() {
+            var year = this.year;
+            var month = this.month;
+            month++;
+            if (month > 12) {
+                month = month - 12;
+                year = year + 1;
+            }
+            this.getCalendar(year, month);
+        },
+        goPre() {
+            var year = this.year;
+            var month = this.month;
+            month--;
+            if (month < 1) {
+                month = 12;
+                year = year - 1;
+            }
+            this.getCalendar(year, month);
+        },
+        submit() {
+            if (!this.chooseDay || !this.chooseTime) {
+                wx.showToast({
+                    title: '请选择时间和日期',
+                    icon: 'none',
+                    duration: 1500,
+                });
+                return;
+            }
+
+            var data = {
+                id: this.orderId,
+            };
+            if (this.orderInfo.statusFlag == OrderStatus.PAYOVER) {
+                data.bookPhotoTime = Date.parse(new Date(this.chooseInfo));
+                data.statusFlag = OrderStatus.BOOKPHOTO;
+            } else if (this.orderInfo.statusFlag == OrderStatus.PHOTOOVER) {
+                data.bookSelectTime = Date.parse(new Date(this.chooseInfo));
+                data.statusFlag = OrderStatus.BOOKSELECT;
+            } else if (this.orderInfo.statusFlag == OrderStatus.SELECTOVER) {
+                data.bookCheckTime = Date.parse(new Date(this.chooseInfo));
+                data.statusFlag = OrderStatus.BOOKCHECK;
+            } else if (this.orderInfo.statusFlag == OrderStatus.CHECKOVER) {
+                data.bookAccessTime = Date.parse(new Date(this.chooseInfo));
+                data.statusFlag = OrderStatus.BOOKACCESS;
+            }
+
+            wx.showLoading({
+                title: '加载中',
+                mask: true,
+            });
+
+            this.$http.post('/userOrderDetail/update', data).then(res => {
+                wx.hideLoading();
+                if (res.success) {
+                    this.$store.commit('updateChangeOrder', true);
+                    wx.showToast({
+                        title: '预约成功',
+                        icon: 'success',
+                        duration: 1500,
+                    });
+                    setTimeout(() => {
+                        wx.navigateBack();
+                    }, 1500);
+                } else {
+                    wx.showToast({
+                        title: res.error,
+                        icon: 'none',
+                        duration: 1500,
+                    });
+                }
+            });
+
+            console.log(data);
+        },
+    },
+};
+</script>
+<style lang='less' scoped>
+.top {
+    height: 44px;
+    background: rgba(242, 244, 245, 1);
+    line-height: 44px;
+    text-align: center;
+    font-size: 14px;
+    font-weight: bold;
+    color: rgba(0, 0, 0, 1);
+    position: relative;
+
+    img {
+        width: 24px;
+        height: 24px;
+        position: absolute;
+        top: 10px;
+
+        &.left {
+            left: 15px;
+        }
+
+        &.right {
+            right: 15px;
+        }
+    }
+}
+.calendar {
+    background: rgba(255, 255, 255, 1);
+    padding: 10px 10px 20px;
+}
+
+.week {
+    display: flex;
+    // justify-content: space-between;
+    span {
+        min-width: 34px;
+        width: 34px;
+        text-align: center;
+        font-size: 12px;
+        color: rgba(203, 201, 213, 1);
+        line-height: 17px;
+        margin: 0 8px;
+    }
+}
+
+.dayList {
+    display: flex;
+    // justify-content: space-between;
+    flex-wrap: wrap;
+    span {
+        min-width: 34px;
+        width: 34px;
+        height: 34px;
+        font-size: 14px;
+        font-weight: bolder;
+        color: rgba(46, 46, 57, 1);
+        line-height: 34px;
+        text-align: center;
+        margin: 0 8px;
+
+        &.not {
+            color: #999;
+        }
+
+        &.now {
+            color: #00c5f2;
+        }
+
+        &.select {
+            background: rgba(0, 197, 242, 1);
+            border-radius: 17px;
+            color: #fff;
+        }
+    }
+}
+
+.chooseTime {
+    background: rgba(242, 244, 245, 1);
+    padding: 10px 0 0;
+    .chooseContent {
+        padding: 0 15px;
+        background: rgba(255, 255, 255, 1);
+        .chooseTop {
+            font-size: 12px;
+            font-weight: bold;
+            color: rgba(153, 153, 153, 1);
+            line-height: 40px;
+        }
+
+        .chooseLableList {
+            display: flex;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            .chooseLable {
+                width: 108px;
+                height: 40px;
+                background: rgba(242, 244, 245, 1);
+                border-radius: 3px;
+                text-align: center;
+                font-size: 14px;
+                font-weight: bold;
+                color: rgba(0, 0, 0, 1);
+                line-height: 40px;
+                margin-bottom: 10px;
+                border: 1px solid rgba(242, 244, 245, 1);
+
+                &.select {
+                    background: rgba(0, 197, 242, 0.1);
+                    border: 1px solid rgba(0, 197, 242, 1);
+                    color: #00c5f2;
+                }
+            }
+        }
+    }
+}
+
+.bottomFixed {
+    height: 56px;
+    button {
+        width: 345px;
+        left: 15px;
+        height: 40px;
+        background: rgba(0, 197, 242, 1);
+        border-radius: 22px;
+        font-size: 15px;
+        font-weight: bold;
+        color: rgba(255, 255, 255, 1);
+        line-height: 40px;
+        position: fixed;
+        bottom: 8px;
+
+        &:active {
+            background: darken((rgba(0, 197, 242, 1)), 10);
+        }
+    }
+}
+</style>

+ 0 - 1
src/pages/caseList/caseList.vue

@@ -49,7 +49,6 @@ export default {
             }
             this.$http
                 .get('/storeCase/page', {
-                    storeId: this.storeInfo.id || 13,
                     currentPage: this.currentPage,
                 })
                 .then(res => {

+ 8 - 3
src/pages/classify/classify.vue

@@ -14,10 +14,10 @@
                      scroll-with-animation
                      @scrolltolower="scrollProduct">
             <div class="rightContent">
-                <!-- <div class="customized">
+                <div class="customized" @click="goCustomize">
                     <img src="/static/images/icon_shirendingzhi.png" alt="">
                     <span>私人定制</span>
-                </div> -->
+                </div>
 
                 <div class="productList">
                     <productClassifyItem v-for="(item,index) in productList" :key="index" :info='item'></productClassifyItem>
@@ -50,7 +50,7 @@ export default {
     },
     onLoad() {
         this.$http
-            .get('/itemType/itemTree')
+            .get('/itemType/itemTree',{},{},false)
             .then(res => {
                 if (res.success) {
                     this.typeList = res.data;
@@ -71,6 +71,11 @@ export default {
                 this.getProduct()
             }
         },
+        goCustomize() {
+            wx.navigateTo({
+                url: '/pages/customize/customize',
+            });
+        },
         getProduct() {
             this.flag = false;
             var data = {

+ 5 - 0
src/pages/customize/customize.js

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

+ 4 - 0
src/pages/customize/customize.json

@@ -0,0 +1,4 @@
+{
+    "navigationBarTitleText": "私人定制",
+    "backgroundColor": "#f2f4f5"
+}

+ 675 - 0
src/pages/customize/customize.vue

@@ -0,0 +1,675 @@
+<template>
+    <div class='container'>
+        <div class="containerTitle">
+            <div class="titleTop" @click="chooseLevel('photographer')">
+                <div class="name">选择摄影师</div>
+                <div class="sub">{{choosePhotographerLevelInfo.levelName}}</div>
+                <img src="/static/images/gouwuche_icon_zhankai.png" alt="">
+            </div>
+            <div class="tips">点击图片可以查看详情</div>
+        </div>
+
+        <div class="list">
+            <customizeItem v-for="(item,index) in filifterPhotographer" type='photographer' @chooseSelect='chooseSelect' :id='item.id' :isChoose="checkChoose('photographer',item.id)" :name='item.serviceName' :image='item.listImage' :key='index'></customizeItem>
+        </div>
+
+        <div class="containerTitle">
+            <div class="titleTop" @click="chooseLevel('makeup_artist')">
+                <div class="name">选择化妆师</div>
+                <div class="sub">{{chooseMakeUpLevelInfo.levelName}}</div>
+                <img src="/static/images/gouwuche_icon_zhankai.png" alt="">
+            </div>
+            <div class="tips">点击图片可以查看详情</div>
+        </div>
+
+        <div class="list">
+            <customizeItem v-for="(item,index) in filifterMakeUp" type='makeup_artist' @chooseSelect='chooseSelect' :id='item.id' :isChoose="checkChoose('makeup_artist',item.id)" :name='item.serviceName' :image='item.listImage' :key='index'></customizeItem>
+        </div>
+
+        <div class="containerTitle">
+            <div class="titleTop" @click="chooseLevel('clothing')">
+                <div class="name">选择服装道具</div>
+                <div class="sub">{{chooseClothingLevelInfo.levelName}}</div>
+                <img src="/static/images/gouwuche_icon_zhankai.png" alt="">
+            </div>
+            <div class="tips">点击图片可以查看详情,可多选</div>
+        </div>
+
+        <div class="list">
+            <customizeItem v-for="(item,index) in filifterClothing" type='clothing' @chooseSelect='chooseSelect' :id='item.id' :isChoose="checkChoose('clothing',item.id)" :name='item.serviceName' :image='item.listImage' :key='index'></customizeItem>
+        </div>
+
+        <div class="containerTitle">
+            <div class="titleTop" @click="chooseLevel('album')">
+                <div class="name">选择相框</div>
+                <div class="sub">{{chooseAlbumLevelInfo.levelName}}</div>
+                <img src="/static/images/gouwuche_icon_zhankai.png" alt="">
+            </div>
+            <div class="tips">点击图片可以查看详情,可多选</div>
+        </div>
+
+        <div class="list">
+            <customizeItem v-for="(item,index) in filifterAlbum" @chooseSelect='chooseSelect' :id='item.id' type='album' :isChoose="checkChoose('album',item.id)" :name='item.serviceName' :image='item.listImage' :key='index'></customizeItem>
+        </div>
+
+        <div class="tipsContnt">
+            <div class="title">不需要选择的服务</div>
+            <div class="content">
+                <div v-for="(item,index) in mandatory" :key="index">{{item.serviceName}}</div>
+            </div>
+            <div class="line"></div>
+            <div class="title">购买须知</div>
+            <div class="content">1、购买后需联系客服预约档期(需提前15-40天) <br />2、用户若选择定金支付,剩余资金可在拍摄前线上支付,也可以线下门店支付 <br />3、最终用户选择的照片数量超过了套餐中标示的数量,则需要补齐相关差价</div>
+        </div>
+
+        <div class="subContent">
+            <span>总价:</span>
+            <span class="price">{{total}}</span>
+            <span class="detail" @click="showDetail=true">详情</span>
+            <img src="/static/images/more.png" @click="showDetail=true" alt="">
+            <div style="flex-grow:1"></div>
+            <button @click="submit">立即下单</button>
+        </div>
+
+        <actionSheet :list='chooseList' label='levelName' :visible='showAction' @close='close'></actionSheet>
+        <customizeDetail :list='allChooseInfo' :mandatory='mandatory' :visible='showDetail' @close="showDetail=false"></customizeDetail>
+        <specificationsContent :visible='showSpecifications' type='customize' :productInfo='productInfo' @close='showSpecifications=false' :totalMoney='total' :chooseType='chooseSpecificationType' :chooseNum='1' @changeType='changeType'  @changeChoose='changeChoose'></specificationsContent>
+
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import customizeItem from '../../components/CustomizeItem';
+import actionSheet from '../../components/ActionSheet';
+import customizeDetail from '../../components/CustomizeDetail';
+import specificationsContent from '../../components/SpecificationsContent';
+import { all } from 'q';
+import calc from '../../calc';
+export default {
+    name: '',
+    data() {
+        return {
+            storeServiceList: '',
+            allPhotographer: [],
+            allPhotographerLevel: [],
+            choosePhotographerLevel: 0,
+            allMakeupList: [],
+            allMakeupLevel: [],
+            chooseMakeupLevel: 0,
+            showAction: false,
+            chooseList: [],
+            chooseType: '',
+            allClothingList: [],
+            allClothingLevel: [],
+            chooseClothingLevel: '0',
+            allAlbumList: [],
+            allAlbumLevel: [],
+            chooseAlbumLevel: 0,
+            choosePhotographer: 0,
+            chooseMakeup: 0,
+            chooseClothing: [],
+            chooseAlbum: [],
+            mandatory: [],
+            showDetail: false,
+            showSpecifications: false,
+            chooseSpecificationType: 'all',
+        };
+    },
+    computed: {
+        ...mapState(['userInfo', 'storeId']),
+        choosePhotographerLevelInfo() {
+            var info = {};
+            var list = [...this.allPhotographerLevel];
+            list.forEach(item => {
+                if (item.id == this.choosePhotographerLevel) {
+                    info = item;
+                }
+            });
+            return info;
+        },
+        filifterPhotographer() {
+            var list = [];
+            var allList = [...this.allPhotographer];
+            allList.forEach(item => {
+                if (
+                    item.typeLevel == this.choosePhotographerLevel ||
+                    this.choosePhotographerLevel == 0
+                ) {
+                    list.push(item);
+                }
+            });
+            return list;
+        },
+        chooseMakeUpLevelInfo() {
+            var info = {};
+            var list = [...this.allMakeupLevel];
+            list.forEach(item => {
+                if (item.id == this.chooseMakeupLevel) {
+                    info = item;
+                }
+            });
+            return info;
+        },
+        filifterMakeUp() {
+            var list = [];
+            var allList = [...this.allMakeupList];
+            allList.forEach(item => {
+                if (
+                    item.typeLevel == this.chooseMakeupLevel ||
+                    this.chooseMakeupLevel == 0
+                ) {
+                    list.push(item);
+                }
+            });
+            return list;
+        },
+        chooseClothingLevelInfo() {
+            var info = {};
+            var list = [...this.allClothingLevel];
+            list.forEach(item => {
+                if (item.id == this.chooseClothingLevel) {
+                    info = item;
+                }
+            });
+            return info;
+        },
+        filifterClothing() {
+            var list = [];
+            var allList = [...this.allClothingList];
+            allList.forEach(item => {
+                if (
+                    item.typeLevel == this.chooseClothingLevel ||
+                    this.chooseClothingLevel == 0
+                ) {
+                    list.push(item);
+                }
+            });
+            return list;
+        },
+        chooseAlbumLevelInfo() {
+            var info = {};
+            var list = [...this.allAlbumLevel];
+            list.forEach(item => {
+                if (item.id == this.chooseAlbumLevel) {
+                    info = item;
+                }
+            });
+            return info;
+        },
+        filifterAlbum() {
+            var list = [];
+            var allList = [...this.allAlbumList];
+            allList.forEach(item => {
+                if (
+                    item.typeLevel == this.chooseAlbumLevel ||
+                    this.chooseAlbumLevel == 0
+                ) {
+                    list.push(item);
+                }
+            });
+            return list;
+        },
+        choosePhotographerInfo() {
+            var info = {};
+            var allList = [...this.allPhotographer];
+            allList.forEach(item => {
+                if (item.id == this.choosePhotographer) {
+                    info = item;
+                }
+            });
+
+            return info;
+        },
+        chooseMakeupInfo() {
+            var info = {};
+            var allList = [...this.allMakeupList];
+            allList.forEach(item => {
+                if (item.id == this.chooseMakeup) {
+                    info = item;
+                }
+            });
+
+            return info;
+        },
+        chooseClothingInfo() {
+            var list = [];
+            var allList = [...this.allClothingList];
+            allList.forEach(item => {
+                if (this.chooseClothing.indexOf(item.id) != -1) {
+                    list.push(item);
+                }
+            });
+
+            return list;
+        },
+        chooseAlbumInfo() {
+            var list = [];
+            var allList = [...this.allAlbumList];
+            allList.forEach(item => {
+                if (this.chooseAlbum.indexOf(item.id) != -1) {
+                    list.push(item);
+                }
+            });
+            return list;
+        },
+        allChooseInfo() {
+            var list = [];
+            if (this.choosePhotographerInfo.id) {
+                list.push(this.choosePhotographerInfo);
+            }
+            if (this.chooseMakeupInfo.id) {
+                list.push(this.chooseMakeupInfo);
+            }
+
+            list = list.concat(this.chooseClothingInfo);
+            list = list.concat(this.chooseAlbumInfo);
+
+            return list;
+        },
+        total() {
+            var money = 0;
+            var mandatory = [...this.mandatory];
+            mandatory.forEach(item => {
+                money = calc.Add(money, item.price || 0);
+            });
+
+            money = calc.Add(
+                money,
+                Number(this.choosePhotographerInfo.price || 0),
+            );
+            money = calc.Add(money, this.chooseMakeupInfo.price || 0);
+
+            var chooseClothingList = [...this.chooseClothingInfo];
+            chooseClothingList.forEach(item => {
+                money = calc.Add(money, item.price || 0);
+            });
+
+            var chooseAlbumInfo = [...this.chooseAlbumInfo];
+            chooseAlbumInfo.forEach(item => {
+                money = calc.Add(money, item.price || 0);
+            });
+            return money;
+        },
+        productInfo() {
+            return {
+                title: '私人定制套餐',
+                typeFlag: 0,
+                price: this.total,
+                downPayment: this.total ? calc.Mul(this.total, 0.3) : 0,
+            };
+        },
+    },
+    onLoad() {
+        this.getStoreService('photographer').then(res => {
+            this.allPhotographer = res;
+        });
+        this.getStoreServiceLevel('photographer').then(res => {
+            res.push({
+                levelName: '全部摄影师',
+                id: 0,
+            });
+            this.allPhotographerLevel = res;
+        });
+
+        this.getStoreService('makeup_artist').then(res => {
+            this.allMakeupList = res;
+        });
+        this.getStoreServiceLevel('makeup_artist').then(res => {
+            res.push({
+                levelName: '全部化妆师',
+                id: 0,
+            });
+            this.allMakeupLevel = res;
+        });
+
+        this.getStoreService('clothing').then(res => {
+            this.allClothingList = res;
+        });
+        this.getStoreServiceLevel('clothing').then(res => {
+            res.push({
+                levelName: '全部服装道具',
+                id: 0,
+            });
+            this.allClothingLevel = res;
+        });
+
+        this.getStoreService('album').then(res => {
+            this.allAlbumList = res;
+        });
+        this.getStoreServiceLevel('album').then(res => {
+            res.push({
+                levelName: '全部相框',
+                id: 0,
+            });
+            this.allAlbumLevel = res;
+        });
+
+        this.getStoreService('song').then(res => {
+            this.mandatory = res;
+        });
+    },
+    methods: {
+        chooseSelect(info) {
+            var type = info.type;
+            var id = info.id;
+            switch (type) {
+                case 'photographer':
+                    if (this.choosePhotographer == id) {
+                        this.choosePhotographer = 0;
+                    } else {
+                        this.choosePhotographer = id;
+                    }
+                    break;
+                case 'makeup_artist':
+                    if (this.chooseMakeup == id) {
+                        this.chooseMakeup = 0;
+                    } else {
+                        this.chooseMakeup = id;
+                    }
+                    break;
+                case 'clothing':
+                    if (this.chooseClothing.indexOf(id) == -1) {
+                        this.chooseClothing.push(id);
+                    } else {
+                        this.chooseClothing.splice(
+                            this.chooseClothing.indexOf(id),
+                            1,
+                        );
+                    }
+                    break;
+                case 'album':
+                    if (this.chooseAlbum.indexOf(id) == -1) {
+                        this.chooseAlbum.push(id);
+                    } else {
+                        this.chooseAlbum.splice(
+                            this.chooseAlbum.indexOf(id),
+                            1,
+                        );
+                    }
+                    break;
+            }
+        },
+        close(value) {
+            if (value != 'close') {
+                switch (this.chooseType) {
+                    case 'photographer':
+                        this.choosePhotographerLevel = value;
+                        break;
+                    case 'makeup_artist':
+                        this.chooseMakeupLevel = value;
+                        break;
+                    case 'clothing':
+                        this.chooseClothingLevel = value;
+                        break;
+                    case 'album':
+                        this.chooseAlbumLevel = value;
+                        break;
+                }
+            }
+            this.showAction = false;
+        },
+        chooseLevel(type) {
+            var list = [];
+            this.chooseType = type;
+            switch (type) {
+                case 'photographer':
+                    list = [...this.allPhotographerLevel];
+                    break;
+                case 'makeup_artist':
+                    list = [...this.allMakeupLevel];
+                    break;
+                case 'clothing':
+                    list = [...this.allClothingLevel];
+                    break;
+                case 'album':
+                    list = [...this.allAlbumLevel];
+                    break;
+            }
+            this.chooseList = list;
+            this.showAction = true;
+        },
+        checkChoose(type, id) {
+            var result = false;
+            switch (type) {
+                case 'photographer':
+                    if (this.choosePhotographer == id) {
+                        result = true;
+                    }
+                    break;
+                case 'makeup_artist':
+                    if (this.chooseMakeup == id) {
+                        result = true;
+                    }
+                    break;
+                case 'clothing':
+                    if (this.chooseClothing.indexOf(id) != -1) {
+                        result = true;
+                    }
+                    break;
+                case 'album':
+                    if (this.chooseAlbum.indexOf(id) != -1) {
+                        result = true;
+                    }
+                    break;
+            }
+            return result;
+        },
+        getStoreService(typeFlag) {
+            return new Promise((resolve, reject) => {
+                this.$http
+                    .get('/storeService/all', {
+                        typeFlag: typeFlag,
+                    })
+                    .then(res => {
+                        if (res.success) {
+                            resolve(res.data);
+                        }
+                    })
+                    .catch(e => {
+                    });
+            });
+        },
+        getStoreServiceLevel(typeFlag) {
+            return new Promise((resolve, reject) => {
+                this.$http
+                    .get(
+                        '/storeServiceLevel/all',
+                        {
+                            typeFlag: typeFlag,
+                        },
+                        {},
+                        false,
+                    )
+                    .then(res => {
+                        if (res.success) {
+                            resolve(res.data);
+                        }
+                    })
+                    .catch(e => {
+                        console.log(e);
+                    });
+            });
+        },
+        submit() {
+            if (!this.choosePhotographer) {
+                wx.showToast({
+                    title: '请选择摄影师',
+                    icon: 'none',
+                    duration: 1500,
+                });
+                return;
+            }
+
+            if (!this.chooseMakeup) {
+                wx.showToast({
+                    title: '请选化妆师',
+                    icon: 'none',
+                    duration: 1500,
+                });
+                return;
+            }
+
+         
+            this.showSpecifications = true;
+
+           
+        },
+        changeType(type) {
+            this.chooseSpecificationType = type;
+        },
+        changeChoose(){
+               var idList = this.allChooseInfo.map(item => {
+                return item.id;
+            });
+            idList = idList.concat(
+                this.mandatory.map(item => {
+                    return item.id;
+                }),
+            );
+
+             wx.navigateTo({
+                url:
+                    '/pages/submit/submit?submitPage=customize&serviceList=' +
+                    idList.join(',')+'&typeFlag='+(this.chooseSpecificationType=='all'?0:1),
+            });
+        }
+    },
+    components: {
+        customizeItem,
+        actionSheet,
+        customizeDetail,
+        specificationsContent,
+    },
+};
+</script>
+<style lang='less' scoped>
+.container {
+    min-height: 100%;
+    background-color: #f2f4f5;
+    // padding-bottom: 10px;
+    box-sizing: border-box;
+}
+.containerTitle {
+    padding: 20px 15px 15px;
+
+    .titleTop {
+        display: flex;
+        align-items: center;
+
+        .name {
+            font-size: 26px;
+            font-weight: bold;
+            color: rgba(0, 0, 0, 1);
+            line-height: 37px;
+            flex-grow: 1;
+        }
+
+        .sub {
+            font-size: 13px;
+            color: rgba(0, 0, 0, 1);
+            line-height: 18px;
+        }
+
+        img {
+            width: 24px;
+            height: 24px;
+        }
+    }
+    .tips {
+        font-size: 13px;
+        color: rgba(153, 153, 153, 1);
+        line-height: 18px;
+        margin-top: 2px;
+    }
+}
+
+.list {
+    padding-left: 15px;
+}
+
+.tipsContnt {
+    margin: 0 15px 15px;
+    background: rgba(255, 255, 255, 1);
+    border-radius: 8px;
+    padding: 0 12px 15px;
+    .title {
+        font-size: 14px;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+        line-height: 20px;
+        padding: 20px 0 10px;
+    }
+
+    .content {
+        font-size: 14px;
+        font-family: PingFangSC-Regular;
+        font-weight: 400;
+        color: rgba(153, 153, 153, 1);
+        line-height: 24px;
+    }
+
+    .line {
+        height: 1px;
+        background-color: #f2f4f5;
+        margin-top: 15px;
+    }
+}
+
+.subContent {
+    height: 56px;
+    background: rgba(255, 255, 255, 1);
+    position: sticky;
+    bottom: 0;
+    z-index: 20;
+
+    display: flex;
+    align-items: center;
+    padding: 0 15px;
+    span {
+        font-size: 12px;
+        color: rgba(56, 56, 56, 1);
+        line-height: 17px;
+    }
+
+    .price {
+        font-size: 22px;
+        font-weight: bold;
+        color: rgba(255, 59, 48, 1);
+        line-height: 30px;
+        margin-left: 3px;
+
+        &::before {
+            font-size: 16px;
+        }
+    }
+
+    img {
+        width: 22px;
+        height: 22px;
+        transition: all ease-in-out 0.3s;
+    }
+    button {
+        width: 136px;
+        height: 40px;
+        background: rgba(0, 197, 242, 1);
+        border-radius: 22px;
+        font-size: 15px;
+        font-weight: bold;
+        color: rgba(255, 255, 255, 1);
+        line-height: 40px;
+
+        &:active {
+            background-color: darken(rgba(0, 197, 242, 1), 10);
+        }
+    }
+
+    .detail {
+        font-size: 12px;
+        color: rgba(0, 197, 242, 1);
+        line-height: 17px;
+        margin-left: 10px;
+    }
+}
+</style>
+
+

+ 3 - 2
src/pages/evaluate/evaluate.vue

@@ -78,8 +78,8 @@ export default {
     onLoad(options) {
         console.log(options);
         this.orderId = options.orderId;
-        if(options.index){
-            this.index=options.index;
+        if (options.index) {
+            this.index = options.index;
         }
         this.$http
             .get('/userOrderDetail/getOne', {
@@ -180,6 +180,7 @@ export default {
                     icon: 'success',
                     duration: 1500,
                 });
+                this.$store.commit('updateChangeOrder', true);
                 setTimeout(() => {
                     wx.navigateBack();
                 }, 1500);

+ 34 - 6
src/pages/login/login.vue

@@ -8,12 +8,17 @@
 </template>
 
 <script>
+import { mapState } from 'vuex';
+import time from '../../time';
 export default {
     data() {
         return {
             sessionKey: '',
         };
     },
+    computed: {
+        ...mapState(['openInfo', 'miniId']),
+    },
     onShow() {
         this.login();
     },
@@ -28,14 +33,12 @@ export default {
                             .post('auth/loginMiniApp', {
                                 code: res.code,
                                 requireToken: true,
+                                miniId: ref.miniId,
                             })
                             .then(res => {
                                 if (res.success) {
                                     ref.sessionKey = res.data.sessionKey;
-                                    wx.setStorageSync(
-                                        'token',
-                                        '' + res.token,
-                                    );
+                                    wx.setStorageSync('token', '' + res.token);
                                     ref.$http.setToken('' + res.token);
                                 }
                             })
@@ -58,17 +61,42 @@ export default {
                     signature: detail.signature,
                     encryptedData: detail.encryptedData,
                     iv: detail.iv,
+                    miniId: this.miniId,
                 })
                 .then(res => {
                     console.log(res);
                     if (res.success) {
                         this.$store.commit('updateUserInfo', res.data);
-                        wx.reLaunch({
-                            url: '/pages/home/home',
+                        this.goPage();
+                    } else {
+                        wx.showToast({
+                            title: '请选择商品',
+                            icon: res.error,
+                            duration: 1500,
                         });
                     }
                 });
         },
+        goPage() {
+            var url = '/pages/home/home';
+            if (this.openInfo.path) {
+                console.log(this.openInfo.query);
+                url = '/' + this.openInfo.path;
+                var info = this.openInfo.query;
+                var query = '';
+                for (var key in info) {
+                    console.log(info[key]);
+                    query = query + key + '=' + info[key] + '&';
+                }
+                if (query) {
+                    query = query.substr(0, query.length - 1);
+                    url = url + '?' + query;
+                }
+            }
+            wx.reLaunch({
+                url: url,
+            });
+        },
     },
 };
 </script>

+ 73 - 28
src/pages/orderDetail/orderDetail.vue

@@ -16,14 +16,12 @@
         <div class="messageInfo">
             <div class="bookingInfo" v-if="bookingTimeText">
                 <div>{{bookingTimeText}}</div>
-
                 <div>
                     店铺地址:{{address}}
                 </div>
-
                 <img class="daohang" @click="goLocation" src="/static/images/icon_daohang (1).png" alt="">
             </div>
-            <div class="text">{{text}}</div>
+            <div class="text" :style="{textAlign:text.length<18?'center':'left'}">{{text}}</div>
             <div class="btnList">
                 <div class="btn-item">
                     <img src="/static/images/xiangqing_icon_kefu.png" alt="">
@@ -45,12 +43,12 @@
         </div>
 
         <div class="payInfo">
-            <div class="order-item">
+            <div class="order-item" v-if="payMode">
                 <div class="name">支付方式</div>
                 <div class="val">{{payMode}}</div>
             </div>
 
-            <div class="line"></div>
+            <div class="line" v-if="payMode"></div>
 
             <div class="sub">
                 <div class="order-item">
@@ -61,7 +59,7 @@
                     <div class="name">创建时间</div>
                     <div class="val">{{createTime}}</div>
                 </div>
-                <div class="order-item">
+                <div class="order-item" v-if="payMode">
                     <div class="name">付款时间</div>
                     <div class="val">{{payTime}}</div>
                 </div>
@@ -71,15 +69,16 @@
         <div class="fixedBottom">
 
             <div class="submitBtn" v-if="hasBookBtn">
-                <button>{{btnText}}</button>
-                <picker class="picker" mode="date" :start="nowDate" @change="bindDateChange">
+                <button @click="bookingTime">{{btnText}}</button>
+                <!-- <picker class="picker" mode="date" :start="nowDate" @change="bindDateChange">
                     <view>
                         当前选择: {{date}}
                     </view>
-                </picker>
+                </picker> -->
             </div>
 
             <button v-if="statusName=='待评价'" class="submit" @click="goEvaluate">立即评价</button>
+            <button v-if="statusName=='待支付'" class="submit" @click="goPay">立即支付</button>
 
         </div>
 
@@ -152,6 +151,8 @@ export default {
             latitude: '',
             longitude: '',
             storeName: '',
+            userOrderidList: [],
+            userOrderId: '',
         };
     },
     computed: {
@@ -173,7 +174,7 @@ export default {
             return this.orderInfo.statusFlag || 0;
         },
         userOrderDetailList() {
-            return [this.orderInfo];
+            return this.orderInfo.id ? [this.orderInfo] : [];
         },
         payMode() {
             var mode = '';
@@ -231,7 +232,9 @@ export default {
             return this.statusName.indexOf('预约') != -1;
         },
         text() {
-            if (this.statusName == '待预约拍照') {
+            if (this.statusName == '待支付') {
+                return '订单还没有支付完成哦,赶快支付吧';
+            } else if (this.statusName == '待预约拍照') {
                 return '订单支付成功,请联系客服确定好档期后点击下方预约按钮进行拍照时间预约';
             } else if (this.statusName == '待拍照') {
                 return '请按照预约日期到达店铺进行拍照,若因故无法按时拍摄,请事先联系客服进行时间调整,感谢您的配合';
@@ -259,25 +262,13 @@ export default {
         },
         bookingTimeText() {
             if (this.statusName == '待拍照') {
-                return (
-                    '拍照时间:' +
-                    formatTime(this.orderInfo.bookPhotoTime, 'YMD')
-                );
+                return '拍照时间:' + formatTime(this.orderInfo.bookPhotoTime);
             } else if (this.statusName == '待选片') {
-                return (
-                    '选片时间:' +
-                    formatTime(this.orderInfo.bookSelectTime, 'YMD')
-                );
+                return '选片时间:' + formatTime(this.orderInfo.bookSelectTime);
             } else if (this.statusName == '待审片') {
-                return (
-                    '审片时间:' +
-                    formatTime(this.orderInfo.bookCheckTime, 'YMD')
-                );
+                return '审片时间:' + formatTime(this.orderInfo.bookCheckTime);
             } else if (this.statusName == '待取件') {
-                return (
-                    '取件时间:' +
-                    formatTime(this.orderInfo.bookAccessTime, 'YMD')
-                );
+                return '取件时间:' + formatTime(this.orderInfo.bookAccessTime);
             } else {
                 return '';
             }
@@ -310,7 +301,6 @@ export default {
 
         this.$http
             .get('/storeIntroduction/getOne', {
-                storeId: this.storeInfo.id || 13,
             })
             .then(res => {
                 if (res.success) {
@@ -323,11 +313,66 @@ export default {
             .catch(e => {
                 console.log(e);
             });
+        if (options.userOrderId) {
+            this.userOrderId = options.userOrderId;
+            this.$http
+                .get('/userOrder/getOne', {
+                    id: options.userOrderId,
+                })
+                .then(res => {
+                    if (res.success) {
+                        this.userOrderidList = res.data.userOrderDetailList.map(
+                            item => {
+                                return item.orderCode;
+                            },
+                        );
+                    }
+                })
+                .catch(e => {
+                    console.log(e);
+                });
+        } else {
+            this.userOrderidList = [];
+            this.userOrderId = 0;
+        }
     },
     onShow() {
         this.getOrder();
     },
     methods: {
+        goPay() {
+            if (this.userOrderidList.length > 1) {
+                var ref = this;
+                wx.showModal({
+                    title: '该订单和其他订单同时下单',
+                    content:
+                        ref.userOrderidList.join(',\r\n ') + '\r\n需要合并付款',
+                    confirmColor: '#00C5F2',
+                    confirmText: '合并付款',
+                    success(res) {
+                        if (res.confirm) {
+                            wx.navigateTo({
+                                url:
+                                    '/pages/submit/submit?orderId=' +
+                                    ref.userOrderId,
+                            });
+                        } else if (res.cancel) {
+                        }
+                    },
+                });
+            } else {
+                wx.navigateTo({
+                    url: '/pages/submit/submit?orderId=' + this.userOrderId,
+                });
+            }
+        },
+        bookingTime() {
+            wx.navigateTo({
+                url:
+                    '/pages/bookingTime/bookingTime?orderId=' +
+                    this.orderInfo.id,
+            });
+        },
         getOrder() {
             this.$http
                 .get('/userOrderDetail/getOne', {

+ 11 - 3
src/pages/orderList/orderList.vue

@@ -77,20 +77,28 @@ export default {
         };
     },
     computed: {
-        ...mapState(['userInfo', 'storeInfo']),
+        ...mapState(['userInfo', 'storeInfo', 'changeOrder']),
     },
     onLoad(options) {
         if (options.orderStatus) {
             this.chooseOrderStatus = options.orderStatus;
         }
-    },
-    onShow() {
         this.orderList = [];
         this.currentPage = 1;
         this.isFinish = false;
         this.flag = false;
         this.getOrderList();
     },
+    onShow() {
+        if (this.changeOrder) {
+            this.orderList = [];
+            this.currentPage = 1;
+            this.isFinish = false;
+            this.flag = false;
+            this.getOrderList();
+            this.$store.commit('updateChangeOrder', false);
+        }
+    },
     methods: {
         chooseTab(info) {
             console.log(info);

+ 1 - 1
src/pages/product/product.vue

@@ -183,6 +183,7 @@ export default {
         },
     },
     onLoad(options) {
+       
         this.refreash();
         this.productId = options.id;
         this.$http
@@ -415,7 +416,6 @@ export default {
                         typeFlag: this.chooseType == 'all' ? 0 : 1,
                         userId: this.$store.state.userInfo.id,
                         productId: this.productId,
-                        storeId: this.productInfo.storeId,
                     };
 
                     this.$http

+ 0 - 1
src/pages/serviceList/serviceList.vue

@@ -46,7 +46,6 @@ export default {
             }
             this.$http
                 .get('/storeService/page', {
-                    storeId: this.storeInfo.id || 13,
                     typeFlag: 'photographer',
                     currentPage: this.currentPage,
                 })

+ 1 - 0
src/pages/shoppingCart/shoppingCart.vue

@@ -249,6 +249,7 @@ export default {
 
     /* padding: 0 30rpx; */
     padding-bottom: 150rpx;
+    box-sizing: border-box;
 }
 
 .config {

+ 0 - 3
src/pages/storeInfo/storeInfo.vue

@@ -77,7 +77,6 @@ export default {
     onLoad() {
         this.$http
             .get('/storeIntroduction/getOne', {
-                storeId: this.storeInfo.id || 13,
             })
             .then(res => {
                 if (res.success) {
@@ -102,7 +101,6 @@ export default {
 
         this.$http
             .get('/storeService/all', {
-                storeId: this.storeInfo.id || 13,
                 storeFlag: 'Y',
                 typeFlag: 'photographer',
             })
@@ -117,7 +115,6 @@ export default {
 
         this.$http
             .get('/storeCase/page', {
-                storeId: this.storeInfo.id || 13,
                 typeFlag: 'case',
                 currentPage: 1,
                 pageNumber: 3,

+ 73 - 4
src/pages/submit/submit.vue

@@ -39,6 +39,9 @@ export default {
             orderInfo: {},
             shoppCartIdList: [],
             shoppCartInfoList: [],
+            serviceList: [],
+            serviceIdList: [],
+            typeFlag: 0,
         };
     },
     computed: {
@@ -102,13 +105,54 @@ export default {
                 });
             } else if (this.pageType == 'pay' && this.orderInfo.id) {
                 list = [...this.orderInfo.userOrderDetailList];
+            } else if (this.submitPage == 'customize') {
+                var orderServiceList = [...this.serviceList];
+                orderServiceList = orderServiceList.map(item => {
+                    return {
+                        serviceId: item.id,
+                        amount: 1,
+                        message: this.message,
+                    };
+                });
+                list = [
+                    {
+                        productInfo: {
+                            title: '私人定制套餐',
+                            typeFlag: this.typeFlag,
+                            price: this.totalCustomizePrice,
+                            downPayment: calc.Mul(
+                                this.totalCustomizePrice,
+                                0.3,
+                            ),
+                        },
+                        productMoney:
+                            this.typeFlag == 0
+                                ? this.totalCustomizePrice
+                                : calc.Mul(this.totalCustomizePrice, 0.3),
+                        useType: '私人定制',
+                        tailorFlag: 'Y',
+                        quantity: 1,
+                        typeFlag: this.typeFlag,
+                        message: this.message,
+                        orderServiceList: orderServiceList,
+                    },
+                ];
             }
 
             return list;
         },
+        totalCustomizePrice() {
+            var money = 0;
+            var list = [...this.serviceList];
+            list.forEach(item => {
+                money = calc.Add(money, item.price || 0);
+            });
+
+            return money;
+        },
     },
     onLoad(options) {
-        this.message=''
+        this.message = '';
         console.log(options);
         this.refreash();
         if (options.submitPage) {
@@ -118,6 +162,13 @@ export default {
                 this.amountList = options.amount.split(',');
                 this.typeFlagList = options.typeFlag.split(',');
                 this.getProduct();
+            } else if (this.submitPage == 'customize') {
+                this.typeFlag = options.typeFlag;
+                this.serviceIdList = options.serviceList.split(',');
+                var serviceIdList = options.serviceList.split(',');
+                serviceIdList.forEach(item => {
+                    this.getServiceList(item);
+                });
             } else {
                 this.shoppCartIdList = options.chooseList.split(',');
                 var shoppCartIdList = options.chooseList.split(',');
@@ -141,6 +192,20 @@ export default {
         }
     },
     methods: {
+        getServiceList(id) {
+            this.$http
+                .get('/storeService/getOne', {
+                    id: id,
+                })
+                .then(res => {
+                    if (res.success) {
+                        this.serviceList.push(res.data);
+                    }
+                })
+                .catch(e => {
+                    console.log(e);
+                });
+        },
         getShoopingCart(id) {
             this.$http
                 .get('/shoppingCart/getOne', {
@@ -166,6 +231,7 @@ export default {
             this.orderInfo = {};
             this.shoppCartIdList = [];
             this.shoppCartInfoList = [];
+            this.serviceList = [];
         },
         changeMessage(message) {
             this.message = message;
@@ -230,17 +296,19 @@ export default {
             return new Promise((resolve, reject) => {
                 var data = {
                     userId: this.userInfo.id,
-                    storeId: this.userOrderDetailList[0].productInfo.storeId,
+                    // storeId: this.userOrderDetailList[0].productInfo.storeId,
                     userOrderDetailList: [...this.userOrderDetailList],
                 };
                 console.log(data);
 
+                if (this.submitPage == 'customize') {
+                    data.tailorFlag = 'Y';
+                }
+
                 data.userOrderDetailList.forEach(item => {
                     delete item.productInfo;
                     delete item.productMoney;
                 });
-
-                console.log(data);
                 wx.showLoading({
                     title: '加载中',
                     mask: true,
@@ -277,6 +345,7 @@ export default {
                 });
             } else {
                 this.payMoney();
+                this.$store.commit('updateChangeOrder', true);
             }
         },
         payMoney() {

+ 12 - 2
src/store/store.js

@@ -7,9 +7,19 @@ const store = new Vuex.Store({
         sysInfo: {
             statusBarHeight: 20,
         },
-        storeInfo: {}
+        storeInfo: {},
+        storeId: 13,
+        openInfo: {},
+        changeOrder: false,
+        miniId: 1
     },
     mutations: {
+        updateChangeOrder(state, changeOrder) {
+            state.changeOrder = changeOrder;
+        },
+        updateOpenInfo(state, info) {
+            state.openInfo = info;
+        },
         updateUserInfo(state, userInfo) {
             state.userInfo = userInfo;
         },
@@ -18,7 +28,7 @@ const store = new Vuex.Store({
         },
         updateStoreInfo(state, storeInfo) {
             state.storeInfo = storeInfo;
-        }
+        },
     },
 });
 export default store;

+ 60 - 14
src/utils/http.js

@@ -1,5 +1,6 @@
 // const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.50.15:8080' : '';
-const baseUrl = 'https://xcx.izouma.com'
+const baseUrl = 'https://xcx.izouma.com';
+import store from '../store';
 
 function parseUrl(url) {
     let _baseUrl = baseUrl;
@@ -17,26 +18,38 @@ function parseUrl(url) {
 export default {
     install(_Vue) {
         _Vue.prototype.$http = {
+            storeId: 13,
             setToken(token) {
                 console.log(token);
                 this.token = token;
             },
-            get(url, params, options) {
+            get(url, params, options, needStore) {
                 options = options || {};
                 let self = this;
                 return new Promise((resolve, reject) => {
                     wx.request({
                         method: 'GET',
                         url: parseUrl(url),
-                        data: params,
+                        data: {
+                            ...params,
+                            storeId: needStore == false ? '' : self.storeId
+                        },
                         dataType: 'json',
                         header: {
-                            token: self.token,
+                            token: self.token || '',
                             ...(options.header || {}),
                         },
                         success(res) {
                             if (res && res.statusCode === 200) {
-                                resolve(res.data);
+                                if (res.data.error == '未登录') {
+                                    wx.reLaunch({
+                                        url: '/pages/login/login',
+                                    });
+
+                                    reject(res);
+                                } else {
+                                    resolve(res.data);
+                                }
                             } else {
                                 reject(res);
                             }
@@ -49,20 +62,32 @@ export default {
             },
             post(url, data, options) {
                 options = options || {};
+                let self = this;
                 return new Promise((resolve, reject) => {
                     wx.request({
                         method: 'post',
                         url: parseUrl(url),
-                        data: data,
+                        data: {
+                            ...data,
+                            storeId: self.storeId
+                        },
                         dataType: 'json',
                         header: {
                             'content-type': 'application/x-www-form-urlencoded',
-                            token: this.token,
+                            token: self.token || '',
                             ...(options.header || {}),
                         },
                         success(res) {
                             if (res && res.statusCode === 200) {
-                                resolve(res.data);
+                                if (res.data.error == '未登录') {
+                                    wx.reLaunch({
+                                        url: '/pages/login/login',
+                                    });
+
+                                    reject(res);
+                                } else {
+                                    resolve(res.data);
+                                }
                             } else {
                                 reject(res);
                             }
@@ -75,19 +100,31 @@ export default {
             },
             postJ(url, data, options) {
                 options = options || {};
+                let self = this;
                 return new Promise((resolve, reject) => {
                     wx.request({
                         method: 'post',
                         url: parseUrl(url),
-                        data: data,
+                        data: {
+                            ...data,
+                            storeId: self.storeId
+                        },
                         dataType: 'json',
                         header: {
-                            token: this.token,
+                            token: self.token || '',
                             ...(options.header || {}),
                         },
                         success(res) {
                             if (res && res.statusCode === 200) {
-                                resolve(res.data);
+                                if (res.data.error == '未登录') {
+                                    wx.reLaunch({
+                                        url: '/pages/login/login',
+                                    });
+
+                                    reject(res);
+                                } else {
+                                    resolve(res.data);
+                                }
                             } else {
                                 reject(res);
                             }
@@ -100,21 +137,30 @@ export default {
             },
             uploadFile(url, filePath, options) {
                 options = options || {};
+                let self = this;
                 return new Promise((resolve, reject) => {
                     wx.uploadFile({
                         url: parseUrl(url),
                         filePath: filePath,
                         name: 'file',
                         formData: {
-                            'user': 'test'
+                            user: 'test',
                         },
                         header: {
-                            token: this.token,
+                            token: self.token || '',
                             ...(options.header || {}),
                         },
                         success(res) {
                             if (res && res.statusCode === 200) {
-                                resolve(res.data);
+                                if (res.data.error == '未登录') {
+                                    wx.reLaunch({
+                                        url: '/pages/login/login',
+                                    });
+
+                                    reject(res);
+                                } else {
+                                    resolve(res.data);
+                                }
                             } else {
                                 reject(res);
                             }

BIN=BIN
static/images/goPre.png


BIN=BIN
static/images/more.png