drew 5 tahun lalu
induk
melakukan
ec7109b3a3

+ 15 - 15
.prettierrc.js

@@ -2,19 +2,19 @@ module.exports = {
     printWidth: 120,
     singleQuote: true,
     tabWidth: 4,
-    overrides: [
-        {
-            files: '*.html',
-            options: {
-                parser: 'html'
-            }
-        },
-        {
-            files: '*.vue',
-            options: {
-                parser: 'vue'
-            }
-        }
-    ],
-    endOfLine: 'auto'
+    // overrides: [
+    //     {
+    //         files: '*.html',
+    //         options: {
+    //             parser: 'html'
+    //         }
+    //     },
+    //     {
+    //         files: '*.vue',
+    //         options: {
+    //             parser: 'vue'
+    //         }
+    //     }
+    // ],
+    trailingCommas: 'none'
 };

+ 146 - 145
project.config.json

@@ -1,146 +1,147 @@
 {
-	"description": "项目配置文件",
-	"packOptions": {
-		"ignore": []
-	},
-	"setting": {
-		"urlCheck": false,
-		"es6": true,
-		"enhance": false,
-		"postcss": true,
-		"preloadBackgroundData": false,
-		"minified": true,
-		"newFeature": true,
-		"coverView": true,
-		"autoAudits": false,
-		"showShadowRootInWxmlPanel": true,
-		"scopeDataCheck": false,
-		"checkInvalidKey": true,
-		"checkSiteMap": true,
-		"uploadWithSourceMap": true,
-		"babelSetting": {
-			"ignore": [],
-			"disablePlugins": [],
-			"outputPath": ""
-		}
-	},
-	"compileType": "miniprogram",
-	"libVersion": "2.11.0",
-	"appid": "wx31f7e5e3081d6927",
-	"projectname": "%E6%8D%B7%E9%80%94JETOUR",
-	"cloudfunctionTemplateRoot": "",
-	"watchOptions": {
-		"ignore": []
-	},
-	"debugOptions": {
-		"hidedInDevtools": []
-	},
-	"scripts": {},
-	"simulatorType": "wechat",
-	"simulatorPluginLibVersion": {},
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"plugin": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"list": []
-		},
-		"gamePlugin": {
-			"current": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": -1,
-			"list": [
-				{
-					"id": -1,
-					"name": "我的",
-					"pathName": "pages/my",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "购车",
-					"pathName": "pages/car",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "途享",
-					"pathName": "pages/tuxiang",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "注册",
-					"pathName": "pages/register",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "登录",
-					"pathName": "pages/login",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "试驾",
-					"pathName": "pages/testDrive",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "选择城市",
-					"pathName": "pages/cityChoose",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "经销商",
-					"pathName": "pages/dealer",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "商品详情",
-					"pathName": "pages/detail",
-					"query": "id=1568948578421550",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "计算器",
-					"pathName": "pages/calculator",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "提交订单",
-					"pathName": "pages/submit",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "添加购车人",
-					"pathName": "pages/addressEdit",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "视频",
-					"pathName": "pages/video",
-					"scene": null
-				}
-			]
-		}
-	}
-}
+    "description": "项目配置文件",
+    "packOptions": {
+        "ignore": []
+    },
+    "setting": {
+        "urlCheck": false,
+        "es6": true,
+        "enhance": false,
+        "postcss": true,
+        "preloadBackgroundData": false,
+        "minified": true,
+        "newFeature": true,
+        "coverView": true,
+        "autoAudits": false,
+        "showShadowRootInWxmlPanel": true,
+        "scopeDataCheck": false,
+        "checkInvalidKey": true,
+        "checkSiteMap": true,
+        "uploadWithSourceMap": true,
+        "babelSetting": {
+            "ignore": [],
+            "disablePlugins": [],
+            "outputPath": ""
+        }
+    },
+    "compileType": "miniprogram",
+    "libVersion": "2.11.0",
+    "appid": "wx31f7e5e3081d6927",
+    "projectname": "%E6%8D%B7%E9%80%94JETOUR",
+    "cloudfunctionTemplateRoot": "",
+    "watchOptions": {
+        "ignore": []
+    },
+    "debugOptions": {
+        "hidedInDevtools": []
+    },
+    "scripts": {},
+    "simulatorType": "wechat",
+    "simulatorPluginLibVersion": {},
+    "condition": {
+        "search": {
+            "current": -1,
+            "list": []
+        },
+        "conversation": {
+            "current": -1,
+            "list": []
+        },
+        "plugin": {
+            "current": -1,
+            "list": []
+        },
+        "game": {
+            "list": []
+        },
+        "gamePlugin": {
+            "current": -1,
+            "list": []
+        },
+        "miniprogram": {
+            "current": -1,
+            "list": [
+                {
+                    "id": -1,
+                    "name": "我的",
+                    "pathName": "pages/my",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "购车",
+                    "pathName": "pages/car",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "途享",
+                    "pathName": "pages/tuxiang",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "注册",
+                    "pathName": "pages/register",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "登录",
+                    "pathName": "pages/login",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "试驾",
+                    "pathName": "pages/testDrive",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "选择城市",
+                    "pathName": "pages/cityChoose",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "经销商",
+                    "pathName": "pages/dealer",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "商品详情",
+                    "pathName": "pages/detail",
+                    "query": "id=1568948578421550",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "计算器",
+                    "pathName": "pages/calculator",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "提交订单",
+                    "pathName": "pages/submit",
+                    "scene": null,
+                    "query": "skuId=1568948578421550&provinceId=32&cityId=3201&dealerId=7024&name=%E6%8D%B7%E9%80%94X70S%20%E6%97%85%E8%A1%8C%E6%99%BA%E8%83%BDSUV%EF%BC%88%E6%8A%A2%E8%AE%A2%E4%B8%AD%EF%BC%89&image=http%3A%2F%2Fshopimg.jetour.com.cn%2F20190920%2F1568948421979.jpg"
+                },
+                {
+                    "id": -1,
+                    "name": "添加购车人",
+                    "pathName": "pages/addressEdit",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "视频",
+                    "pathName": "pages/video",
+                    "scene": null
+                }
+            ]
+        }
+    }
+}

+ 3 - 0
src/App.vue

@@ -159,4 +159,7 @@ export default {
 .f18 {
     font-size: 18px;
 }
+.b {
+    font-weight: bold;
+}
 </style>

+ 2 - 1
src/main.js

@@ -128,7 +128,8 @@ export default {
             'van-overlay': '/vant/overlay/index',
             'van-stepper': '/vant/stepper/index',
             'van-steps': '/vant/steps/index',
-            'van-rate': '/vant/rate/index'
+            'van-rate': '/vant/rate/index',
+            'van-popup': '/vant/popup/index'
         },
         permission: {
             'scope.userLocation': {

TEMPAT SAMPAH
src/native/imgs/tap_car_nor.png


TEMPAT SAMPAH
src/native/imgs/tap_car_sel.png


TEMPAT SAMPAH
src/native/imgs/tap_home_nor.png


TEMPAT SAMPAH
src/native/imgs/tap_home_sel.png


TEMPAT SAMPAH
src/native/imgs/tap_me_nor.png


TEMPAT SAMPAH
src/native/imgs/tap_me_sel.png


TEMPAT SAMPAH
src/native/imgs/tap_tour_nor.png


TEMPAT SAMPAH
src/native/imgs/tap_tour_sel.png


+ 7 - 19
src/pages/addressEdit.vue

@@ -1,10 +1,6 @@
 <config>
 {
-    "navigationBarTitleText": "填写个人信息",
-    "disableScroll": true,
-		"usingComponents": {
-    		"van-popup": "../vant/popup/index"
-  	}
+    "navigationBarTitleText": "填写个人信息"
 }
 </config>
 <template>
@@ -67,9 +63,7 @@
                     >设置为默认购车人</van-checkbox
                 >
             </van-cell>
-            <div class="btn-wrapper">
-                <van-button block :color="$colors.prim" @click="onSubmit">保存</van-button>
-            </div>
+            <van-button block :color="$colors.prim" @click="onSubmit" class="btn-save">保存</van-button>
         </van-cell-group>
 
         <van-popup :show="showPicker" position="bottom">
@@ -146,13 +140,6 @@ export default {
                         this.form = { ...res.data };
                     });
             } else {
-                Dialog.alert({
-                    message: '收获地址请填写真实购车人姓名和手机号,否则会影响权益领取!',
-                    showCancelButton: true,
-                    className: 'custom-class-name'
-                }).then(() => {
-                    // on close
-                });
                 return Promise.resolve();
             }
         },
@@ -293,15 +280,16 @@ page {
     }
 }
 
-.btn-wrapper {
+.btn-save {
     position: fixed;
     bottom: 0;
     left: 0;
     width: 100%;
-    padding-bottom: env(safe-area-inset-bottom);
-    button {
-        height: 55px;
+    .van-button {
         border-radius: 0;
+        padding-bottom: calc(env(safe-area-inset-bottom) / 2) !important;
+        height: calc(52px + env(safe-area-inset-bottom) / 2) !important;
+        font-size: 15px;
     }
 }
 .dialog-index--custom-class-name {

+ 201 - 183
src/pages/addressList.vue

@@ -1,183 +1,201 @@
-<config>
-{
-'navigationBarTitleText': '收货地址管理',
-}
-</config>
-
-<template>
-    <div class="address-content">
-        <van-empty description="无数据" v-if="addresses.length === 0" />
-
-        <div v-for="item in addresses" :key="item.id">
-            <div class="address">
-                <div class="address-top">
-                    <div class="text1">
-                        <span>{{ item.name }} </span><span>{{ item.mobile }}</span>
-                    </div>
-                    <div class="text2">{{ item.address }}{{ item.detailAddress }}</div>
-                </div>
-                <div class="btnList">
-                    <van-checkbox
-                        class="checkbox"
-                        readonly
-                        v-if="item.isDefault"
-                        :value="true"
-                        :checked-color="$colors.prim"
-                    >
-                        默认购车人
-                    </van-checkbox>
-
-                    <van-button size="small" icon="edit" @click="addressEdit(item.id)">编辑</van-button>
-                    <van-button size="small" icon="delete" @click="del(item.id)">删除</van-button>
-                </div>
-            </div>
-        </div>
-
-        <div class="btn-wrapper">
-            <van-button class="bottomBtn" block :color="$colors.prim" @click="addressEdit(0)"
-                >添加购车人(收货地址)</van-button
-            >
-        </div>
-        <van-dialog id="van-dialog" />
-    </div>
-</template>
-<script>
-import Dialog from '../vant/dialog/dialog';
-export default {
-    data() {
-        return {
-            addresses: []
-        };
-    },
-    onShow() {
-        this.getList();
-    },
-    methods: {
-        getList() {
-            this.$http.get('/applets/querycustomeraddress').then(res => {
-                this.addresses = res.data;
-            });
-        },
-        addressEdit(id) {
-            wx.navigateTo({
-                url: '/pages/addressEdit' + (id ? `?id=${id}` : '')
-            });
-        },
-        del(id) {
-            Dialog.confirm({
-                title: '您确认要删除这个地址?',
-                // message: '您确认要删除这个地址?',
-                className: 'custom-class-name',
-                cancelButtonText: '再想想'
-            })
-                .then(() => {
-                    this.$http
-                        .get('/applets/deletecustomeraddress', {
-                            addressId: id
-                        })
-                        .then(res => {
-                            if (res.data === 1) {
-                                this.getList();
-                                this.showToastError('删除成功', 'success');
-                            } else {
-                                this.showToastError('删除失败');
-                            }
-                        });
-                })
-                .catch(() => {});
-        }
-    }
-};
-</script>
-<style lang="less" scoped>
-.bottomBtn {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-}
-
-.address {
-    margin: 0 15px;
-    border: 1px solid #ececec;
-    border-radius: 5px;
-    box-shadow: 0 0 10px 2px #ececec;
-}
-
-.address-top {
-    padding: 18px 10px 22px;
-    .text1 {
-        span {
-            font-size: 15px;
-            font-weight: bold;
-            color: #343434;
-            line-height: 18px;
-        }
-        span + span {
-            margin-left: 15px;
-        }
-    }
-
-    .text2 {
-        font-size: 12px;
-        font-weight: bold;
-        color: #666666;
-        line-height: 18px;
-        margin-top: 16px;
-    }
-}
-
-.address-content {
-    padding: 15px 0;
-}
-
-.btnList {
-    display: flex;
-    align-items: center;
-    padding: 15px;
-    position: relative;
-    &::before {
-        content: '';
-        position: absolute;
-        top: 0px;
-        right: 5px;
-        left: 5px;
-        height: 1px;
-        background-color: #dedede;
-    }
-
-    .checkbox {
-        flex-grow: 1;
-    }
-}
-</style>
-
-<style lang="less">
-.btnList {
-    .van-checkbox {
-        font-size: 12px;
-        line-height: 18px;
-        .van-checkbox__label {
-            color: #109a9a;
-            font-weight: bold;
-        }
-    }
-
-    .van-button {
-        border-width: 0px;
-    }
-}
-.bottomBtn {
-    .van-button {
-        height: 55px;
-        line-height: 55px;
-        font-size: 14px;
-    }
-}
-
-.dialog-index--custom-class-name {
-    .dialog-index--van-dialog__confirm {
-        color: @prim !important;
-    }
-}
-</style>
+<config>
+{
+    "navigationBarTitleText": '收货地址管理'
+}
+</config>
+<template>
+    <div class="address-content">
+        <van-empty description="无数据" v-if="addresses.length === 0" />
+
+        <div v-for="item in addresses" :key="item.id">
+            <div class="address" @click="pickAddress(item)">
+                <div class="address-top">
+                    <div class="text1">
+                        <span>{{ item.name }} </span><span>{{ item.mobile }}</span>
+                    </div>
+                    <div class="text2">{{ item.address }}{{ item.detailAddress }}</div>
+                </div>
+                <div class="btnList">
+                    <van-checkbox
+                        class="checkbox"
+                        readonly
+                        v-if="item.isDefault === '1'"
+                        :value="true"
+                        :checked-color="$colors.prim"
+                    >
+                        默认购车人
+                    </van-checkbox>
+                    <div class="checkbox" v-else></div>
+
+                    <van-button size="small" icon="edit" @click.stop="addressEdit(item.id)">编辑</van-button>
+                    <van-button size="small" icon="delete" @click.stop="del(item.id)">删除</van-button>
+                </div>
+            </div>
+        </div>
+
+        <div class="btn-wrapper">
+            <van-button class="bottomBtn" block :color="$colors.prim" @click="addressEdit(0)">
+                添加购车人(收货地址)
+            </van-button>
+        </div>
+        <van-dialog id="van-dialog" />
+    </div>
+</template>
+<script>
+import Dialog from '../vant/dialog/dialog';
+export default {
+    data() {
+        return {
+            addresses: [],
+            eventChannel: null,
+            pick: false
+        };
+    },
+    onShow() {
+        this.getList();
+        this.eventChannel = this.$mp.page.getOpenerEventChannel();
+        this.pick = this.$mp.query.pick === 'true';
+    },
+    methods: {
+        getList() {
+            this.$http.get('/applets/querycustomeraddress').then(res => {
+                this.addresses = res.data;
+            });
+        },
+        addressEdit(id) {
+            wx.navigateTo({
+                url: '/pages/addressEdit' + (id ? `?id=${id}` : '')
+            });
+        },
+        del(id) {
+            Dialog.confirm({
+                title: '您确认要删除这个地址?',
+                // message: '您确认要删除这个地址?',
+                className: 'custom-class-name',
+                cancelButtonText: '再想想'
+            })
+                .then(() => {
+                    this.$http
+                        .get('/applets/deletecustomeraddress', {
+                            addressId: id
+                        })
+                        .then(res => {
+                            if (res.data === 1) {
+                                this.getList();
+                                this.showToastError('删除成功', 'success');
+                            } else {
+                                this.showToastError('删除失败');
+                            }
+                        });
+                })
+                .catch(() => {});
+        },
+        pickAddress(item) {
+            if (this.pick && this.eventChannel && this.eventChannel.emit) {
+                this.eventChannel.emit('pickAddress', item);
+                wx.navigateBack();
+            }
+        }
+    }
+};
+</script>
+<style lang="less">
+.bottomBtn {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    .van-button {
+        border-radius: 0;
+        padding-bottom: calc(env(safe-area-inset-bottom) / 2) !important;
+        height: calc(52px + env(safe-area-inset-bottom) / 2) !important;
+        font-size: 15px;
+    }
+}
+
+.address {
+    margin: 0 15px;
+    border: 1px solid #ececec;
+    border-radius: 5px;
+    box-shadow: 0 0 10px 2px #ececec;
+}
+
+.address-top {
+    padding: 18px 10px 22px;
+    .text1 {
+        span {
+            font-size: 15px;
+            font-weight: bold;
+            color: #343434;
+            line-height: 18px;
+        }
+        span + span {
+            margin-left: 15px;
+        }
+    }
+
+    .text2 {
+        font-size: 12px;
+        font-weight: bold;
+        color: #666666;
+        line-height: 18px;
+        margin-top: 16px;
+    }
+}
+
+.address-content {
+    padding: 15px 0;
+}
+
+.btnList {
+    display: flex;
+    align-items: center;
+    padding: 15px;
+    position: relative;
+    &::before {
+        content: '';
+        position: absolute;
+        top: 0px;
+        right: 5px;
+        left: 5px;
+        height: 1px;
+        background-color: #dedede;
+    }
+
+    .checkbox {
+        flex-grow: 1;
+    }
+}
+.btnList {
+    .van-checkbox {
+        font-size: 12px;
+        line-height: 18px;
+        .van-checkbox__label {
+            color: #109a9a;
+            font-weight: bold;
+        }
+    }
+
+    .van-button {
+        border-width: 0px;
+    }
+}
+.bottomBtn {
+    .van-button {
+        height: 55px;
+        line-height: 55px;
+        font-size: 14px;
+    }
+}
+
+.dialog-index--custom-class-name {
+    .dialog-index--van-dialog__confirm {
+        color: @prim !important;
+    }
+}
+.bottomBtn {
+    button {
+        border-radius: 0;
+    }
+}
+</style>

+ 3 - 3
src/pages/car.vue

@@ -13,10 +13,10 @@
         </van-sticky>
         <div class="model-list" v-if="tab === 'all'">
             <div class="model" v-for="item in carModels" :key="item.skuId">
-                <img :src="item.appImgurl" class="cover" mode="aspectFill" />
+                <img :src="item.appToImgurl" class="cover" mode="aspectFill" />
                 <div class="info">
                     <div class="name">{{ item.name }}</div>
-                    <div class="desc">{{ item.desc }}</div>
+                    <div class="desc">{{ item.checkDesc }}</div>
                     <div class="price-btn">
                         <div class="price">¥{{ item.price }}</div>
                         <div class="btn">立即下订</div>
@@ -151,7 +151,7 @@
 export default {
     data() {
         return {
-            tab: 'custom',
+            tab: 'all',
             carModels: [],
             colorList: [],
             currentColor: null,

+ 3 - 0
src/pages/dealer.vue

@@ -252,6 +252,9 @@ export default {
                     }
                 )
                 .then(res => {
+                    res.data = res.data.filter(
+                        i => i.showWebsiteFlag == 1 && !(typeof i.code === 'string' && i.code.startsWith('99999'))
+                    );
                     if (this.location) {
                         res.data.forEach(i => {
                             if (i.warpLatitude) {

+ 481 - 11
src/pages/detail.vue

@@ -31,59 +31,410 @@
                     <img src="../static/imgs/icon_into.png" class="into" />
                 </div>
                 <div class="desc-item" v-for="(detailItem, i) in item.descDetailList" :key="i">
-                    <div class="tag" v-if="detailItem.tip">{{ detailItem.tip }}</div>
+                    <div class="tag" v-if="detailItem.tip">
+                        {{ detailItem.tip }}
+                    </div>
                     <div class="content">{{ detailItem.content }}</div>
                 </div>
                 <div class="divider" v-if="index < ((info.sku || {}).descInformationList || []).length - 1"></div>
             </div>
         </div>
+        <div class="form-block">
+            <div class="item">
+                <div class="label">适用车型:</div>
+                <div class="value">全部车型</div>
+                <img src="../static/imgs/icon_into.png" class="into" />
+            </div>
+            <div class="item">
+                <div class="label">选择颜色:</div>
+                <div class="value">到店为准</div>
+                <img src="../static/imgs/icon_into.png" class="into" />
+            </div>
+            <div class="item" @click="showCityPicker = true">
+                <div class="label">选择城市:</div>
+                <div class="value" v-if="cityId">{{ cityName }}</div>
+                <div class="value placeholder" v-else>请选择</div>
+                <img src="../static/imgs/icon_into.png" class="into" />
+            </div>
+            <div class="item noborder" @click="chooseDealer">
+                <div class="label">线下提车:</div>
+                <div class="value" v-if="dealerId">{{ dealerName }}</div>
+                <div class="value placeholder" v-else>请选择</div>
+                <img src="../static/imgs/icon_into.png" class="into" />
+            </div>
+        </div>
         <div class="tabs flex">
-            <div class="tab f15 text2 flex center" :class="{ active: tab === 0 }" @click="tab = 0">商品详情</div>
-            <div class="tab f15 text2 flex center" :class="{ active: tab === 1 }" @click="tab = 1">参数配置</div>
-            <div class="tab f15 text2 flex center" @click="calculator">贷款计算器</div>
+            <div class="tab f15 text2 flex center" :class="{ active: tab === 0 }" @click="tab = 0">
+                商品详情
+            </div>
+            <div class="tab f15 text2 flex center" :class="{ active: tab === 1 }" @click="(tab = 1), scroll()">
+                参数配置
+            </div>
+            <div class="tab f15 text2 flex center" @click="calculator">
+                贷款计算器
+            </div>
         </div>
-        <div class="detail-wrapper" style="padding-bottom: calc(env(safe-area-inset-bottom) + 44px);">
+        <div class="detail-wrapper" style="font-size: 0; padding-bottom: calc(env(safe-area-inset-bottom) + 44px)">
             <rich-text :nodes="info.mobileDesc || ''" v-if="tab === 0"></rich-text>
-            <rich-text :nodes="info.mobileConfig || ''" v-if="tab === 1"></rich-text>
+            <div v-if="tab === 1" class="specs-container">
+                <div class="specs-card" v-if="config">
+                    <div class="title">{{ info.name.split(' ')[0] }}</div>
+                    <div class="dropdown f12 text1" @click="showModelPicker = true">
+                        <div style="flex-grow: 1">{{ config.name }}</div>
+                        <img src="../static/imgs/icon_dropdown.png" />
+                    </div>
+                    <div class="tip f11">
+                        <div class="item"><span class="sym">●</span>标配</div>
+                        <div class="item"><span class="sym">○</span>选配</div>
+                        <div class="item"><span class="sym">–</span>无</div>
+                    </div>
+                    <div class="row">
+                        <div class="col1">官方指导价</div>
+                        <div class="col2 prim b f12">¥{{ numberWithCommas(config.officialQuotes) }}起</div>
+                    </div>
+                    <div class="spec-group" v-for="(item, i) in specs" :key="i">
+                        <div class="head" @click="item.show = !item.show">
+                            <img
+                                :src="
+                                    item.show ? require('../static/imgs/minus.png') : require('../static/imgs/plus.png')
+                                "
+                                class="icon"
+                            />
+                            <div>{{ item.name }}</div>
+                        </div>
+                        <div v-if="item.show">
+                            <div class="row" v-for="(child, j) in item.children" :key="j">
+                                <div class="col1">{{ child.name }}</div>
+                                <div class="col2">{{ child.value }}</div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="f11 text1" style="margin: 15px 0 0 35px">
+                    备注:详情可咨询当地经销商
+                </div>
+            </div>
         </div>
         <van-button :color="$colors.prim" block class="btn-order" @click="submit">立即下订</van-button>
+        <van-action-sheet :show="showModelPicker">
+            <van-picker
+                :columns="models"
+                show-toolbar
+                title="选择车型"
+                value-key="name"
+                @cancel="showModelPicker = false"
+                @confirm="confirmModel"
+                id="modelPicker"
+            ></van-picker>
+        </van-action-sheet>
+
+        <van-action-sheet :show="showCityPicker">
+            <!-- eslint-disable -->
+            <van-picker
+                :columns="[
+                    { values: [], className: 'column1' },
+                    { values: [], className: 'column2' }
+                ]"
+                value-key="name"
+                show-toolbar
+                title="选择城市"
+                @cancel="showCityPicker = false"
+                @confirm="confirmCity"
+                @change="pickerChange"
+                id="cityPicker"
+            />
+            <!-- eslint-enable -->
+        </van-action-sheet>
+
+        <van-action-sheet :show="showDealerPicker">
+            <van-picker
+                :columns="dealerList"
+                value-key="name"
+                show-toolbar
+                title="选择经销商"
+                @cancel="showDealerPicker = false"
+                @confirm="confirmDealer"
+                id="dealerPicker"
+            />
+        </van-action-sheet>
     </div>
 </template>
 <script>
+import qs from 'qs';
+var QQMapWX = require('../qqmap-wx-jssdk.js');
+let qqmapsdk;
 export default {
     data() {
         return {
             info: {},
-            tab: 0
+            tab: 0,
+            showModelPicker: false,
+            models: [],
+            config: null,
+            specs: [],
+            provinceName: null,
+            provinceId: null,
+            cityName: null,
+            cityId: null,
+            showCityPicker: null,
+            picker: null,
+            dealerName: '',
+            dealerId: null,
+            dealerList: [],
+            showDealerPicker: false
         };
     },
     created() {
+        qqmapsdk = new QQMapWX({
+            key: 'MC4BZ-4QDWP-B5ZDD-VS3HX-NHBAO-CRBOQ'
+        });
+        this.locate();
         this.$http
             .get('/applets/queryspudetail', {
                 skuId: this.$mp.query.id
             })
             .then(res => {
-                console.log(res.data);
                 if (res.data.mobileDesc) {
                     res.data.mobileDesc = res.data.mobileDesc.replace(/<img/g, '<img class="rich-text-img"');
                 }
                 if (res.data.mobileConfig) {
                     res.data.mobileConfig = res.data.mobileConfig.replace(/<img/g, '<img class="rich-text-img"');
                 }
-                console.log(res.data.mobileConfig);
                 this.info = res.data;
+                this.$http
+                    .get(
+                        // eslint-disable-next-line prettier/prettier
+                        `https://dealer.jetour.com.cn/api-basic/api/carmodel/front/findCarModelBySeriesId/${res.data.categories[0].carSystem}`,
+                        {},
+                        {
+                            header: {
+                                Authorization: ''
+                            }
+                        }
+                    )
+                    .then(res => {
+                        this.models = res;
+                        this.getConfig(res[0].id);
+                    });
+                this.$http
+                    .get(
+                        // eslint-disable-next-line prettier/prettier
+                        `https://dealer.jetour.com.cn/api-dealer/dealer-info/getProvinceBySeriesId/0cbe50af-c29a-4eb0-91cc-4a05c5f05c57/${res.data.categories[0].carSystem}`,
+                        {},
+                        { header: { Authorization: '' } }
+                    )
+                    .then(res => {
+                        this.picker.setColumnValues(
+                            0, //
+                            res.data.sort((a, b) => a.id - b.id)
+                        );
+                        if (res.data[0]) {
+                            this.pickerChange({
+                                detail: {
+                                    index: 0,
+                                    value: [res.data[0]]
+                                }
+                            });
+                        }
+                    });
             });
     },
+    onShow() {
+        this.picker = this.$mp.page.selectComponent('#cityPicker');
+    },
     methods: {
+        locate() {
+            let province, city, provinceId, cityId;
+            this.$http
+                .get('https://apis.map.qq.com/ws/location/v1/ip', {
+                    key: 'MC4BZ-4QDWP-B5ZDD-VS3HX-NHBAO-CRBOQ'
+                })
+                .then(res => {
+                    console.log(res);
+                    this.location = res.result.location;
+                    province = res.result.ad_info.province;
+                    city = res.result.ad_info.city;
+                    return this.$http.get(
+                        'https://dealer.jetour.com.cn/api-basic/api/region/findAllProvinces',
+                        {},
+                        {
+                            header: {
+                                Authorization: ''
+                            }
+                        }
+                    );
+                })
+                .then(res => {
+                    provinceId = (res.find(i => i.name === province) || {}).id;
+                    if (provinceId) {
+                        return this.$http.get(
+                            `https://dealer.jetour.com.cn/api-basic/api/region/findCityByProvinceId/${provinceId}`,
+                            {},
+                            {
+                                header: {
+                                    Authorization: ''
+                                }
+                            }
+                        );
+                    } else {
+                        return Promise.reject('找不到省份');
+                    }
+                })
+                .then(res => {
+                    cityId = (res.find(i => i.name === city) || {}).id;
+                    if (cityId) {
+                        return Promise.resolve();
+                    } else {
+                        return Promise.reject('找不到城市');
+                    }
+                })
+                .then(() => {
+                    console.log(provinceId, cityId);
+                    this.provinceName = province;
+                    this.cityName = city;
+                    this.provinceId = provinceId;
+                    this.cityId = cityId;
+                    this.getDealer();
+                })
+                .catch(e => {
+                    console.log(e);
+                });
+        },
         calculator() {
             wx.navigateTo({
                 url: '/pages/calculator'
             });
         },
         submit() {
+            if (!this.cityId) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请选择城市'
+                });
+                return;
+            }
+            if (!this.dealerId) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请选择经销商'
+                });
+                return;
+            }
             wx.navigateTo({
-                url: '/pages/submit'
+                url:
+                    '/pages/submit?' +
+                    qs.stringify({
+                        skuId: this.info.id,
+                        provinceId: this.provinceId,
+                        cityId: this.cityId,
+                        dealerId: this.dealerId,
+                        name: this.info.name,
+                        image: this.info.images[0]
+                    })
+            });
+        },
+        scroll() {
+            const query = wx.createSelectorQuery();
+            query.select('.tabs').boundingClientRect();
+            query.selectViewport().scrollOffset();
+            query.exec(function(res) {
+                console.log(res);
+                wx.pageScrollTo({
+                    scrollTop: res[0].top + res[1].scrollTop,
+                    duration: 250
+                });
             });
+        },
+        confirmModel(e) {
+            let value = this.$mp.page.selectComponent('#modelPicker').getColumnValue(0);
+            this.getConfig(value.id);
+            this.showModelPicker = false;
+        },
+        getConfig(id) {
+            this.$http
+                .get(
+                    `https://dealer.jetour.com.cn/api-basic/api/carmodel/front/${id}`,
+                    {},
+                    { header: { Authorization: '' } }
+                )
+                .then(res => {
+                    this.specs = JSON.parse(res.config).map((i, index) => {
+                        i.name = i.name.replace('■', '');
+                        i.show = index === 0;
+                        return i;
+                    });
+                    console.log('config::', this.specs);
+                    this.config = res;
+                });
+        },
+        numberWithCommas(x) {
+            return x.toLocaleString('en');
+        },
+        confirmCity() {
+            this.provinceId = this.picker.getColumnValue(0).id;
+            this.provinceName = this.picker.getColumnValue(0).name;
+            this.cityId = this.picker.getColumnValue(1).id;
+            this.cityName = this.picker.getColumnValue(1).name;
+            this.showCityPicker = false;
+            this.dealerName = '';
+            this.dealerId = null;
+            this.getDealer();
+        },
+        pickerChange(e) {
+            if (e.detail.index === 0) {
+                this.$http
+                    .get(
+                        // eslint-disable-next-line prettier/prettier
+                        `https://dealer.jetour.com.cn/api-dealer/dealer-info/getCityBySeriesIdAndProvinceId/0cbe50af-c29a-4eb0-91cc-4a05c5f05c57/${this.info.categories[0].carSystem}/${e.detail.value[0].id}`
+                    )
+                    .then(res => {
+                        this.picker.setColumnValues(
+                            1, //
+                            res.data.sort((a, b) => a.id - b.id)
+                        );
+                    });
+            }
+        },
+        getDealer() {
+            this.$http
+                .post(
+                    'https://dealer.jetour.com.cn/api-dealer/dealer-info/searchDealerListByCondition',
+                    {
+                        brandId: '0cbe50af-c29a-4eb0-91cc-4a05c5f05c57',
+                        provinceId: this.provinceId,
+                        cityId: this.cityId,
+                        enabledFlag: 1,
+                        type: 1
+                    },
+                    {
+                        header: {
+                            Authorization: '',
+                            'Content-Type': 'application/json'
+                        }
+                    }
+                )
+                .then(res => {
+                    res.data = res.data.filter(
+                        i => i.showWebsiteFlag == 1 && !(typeof i.code === 'string' && i.code.startsWith('99999'))
+                    );
+                    this.dealerList = res.data;
+                });
+        },
+        chooseDealer() {
+            if (!this.cityId) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请先选择城市'
+                });
+                return;
+            }
+            this.showDealerPicker = true;
+        },
+        confirmDealer() {
+            let value = this.$mp.page.selectComponent('#dealerPicker').getColumnValue(0);
+            this.dealerName = value.name;
+            this.dealerId = value.id;
+            this.showDealerPicker = false;
         }
     }
 };
@@ -183,6 +534,36 @@ page {
         margin-bottom: 6px;
     }
 }
+.form-block {
+    background: white;
+    padding: 0 25px;
+    margin-top: 10px;
+    .item {
+        .flex();
+        font-size: 15px;
+        border-bottom: 1px solid #dedede;
+        height: 45px;
+        .label {
+            width: 80px;
+            color: @text3;
+        }
+        .value {
+            flex-grow: 1;
+            color: @text1;
+            .ellipsis();
+        }
+        .placeholder {
+            color: @text3;
+        }
+        .into {
+            width: 24px;
+            height: 24px;
+        }
+        &.noborder {
+            border: none;
+        }
+    }
+}
 .tabs {
     align-items: flex-start;
     background: white;
@@ -215,9 +596,98 @@ rich-text {
     bottom: 0;
     left: 0;
     right: 0;
-    bottom: env(safe-area-inset-bottom);
     .van-button {
         border-radius: 0;
+        padding-bottom: calc(env(safe-area-inset-bottom) / 2) !important;
+        height: calc(52px + env(safe-area-inset-bottom) / 2) !important;
+        font-size: 15px;
+    }
+}
+.specs-container {
+    padding: 16px;
+    background: @bg;
+    .specs-card {
+        background: #ffffff;
+        border: 1px solid #ececec;
+        box-shadow: 0px 1px 6px 0 rgba(0, 0, 0, 0.08);
+        border-radius: 6px;
+        .title {
+            padding: 34px 0 30px 0;
+            text-align: center;
+            border-bottom: 1px solid @border5;
+            font-size: 21px;
+            color: @text1;
+        }
+        .dropdown {
+            .flex();
+            height: 34px;
+            border-bottom: 1px solid @border5;
+            padding: 0 11px 0 22px;
+            font-weight: bold;
+            img {
+                width: 15px;
+                height: 15px;
+            }
+        }
+        .tip {
+            .flex();
+            height: 34px;
+            border-bottom: 1px solid @border5;
+            padding: 0 11px 0 22px;
+            font-weight: bold;
+            color: @text2;
+            .item {
+                margin-right: 20px;
+                .sym {
+                    margin-right: 5px;
+                }
+            }
+        }
+        .row {
+            .flex();
+            font-size: 11px;
+            border-bottom: 1px solid @border5;
+            align-items: stretch;
+            .col1,
+            .col2 {
+                flex-basis: 0;
+                flex-grow: 1;
+                .flex();
+                padding: 11px 10px;
+            }
+            .col1 {
+                justify-content: start;
+                padding-left: 22px;
+                border-right: 1px solid @border5;
+                color: @text1;
+            }
+            .col2 {
+                justify-content: center;
+                color: @text1;
+                padding: 11px 10px;
+            }
+            .prim {
+                color: @prim;
+            }
+            &.noborder {
+                border: none;
+            }
+        }
+        .head {
+            height: 34px;
+            .flex();
+            font-size: 11px;
+            border-bottom: 1px solid @border5;
+            padding-left: 23px;
+            font-size: 15px;
+            color: @text1;
+            background: #ececec;
+            .icon {
+                width: 15px;
+                height: 15px;
+                margin-right: 11px;
+            }
+        }
     }
 }
 </style>

+ 1 - 2
src/pages/home.vue

@@ -81,8 +81,7 @@
                             </div>
                             <div class="col2">
                                 <div class="price">
-                                    指导价:<span style="font-size: 14px;">{{ item.price }}</span
-                                    >万起
+                                    指导价:<span style="font-size: 14px;">{{ item.monthDesc.split(' ')[0] }}</span>
                                 </div>
                                 <div class="btn" @click="detail(item)">{{ item.button }}</div>
                             </div>

+ 132 - 10
src/pages/submit.vue

@@ -7,7 +7,15 @@
     <div>
         <div class="addr-info flex" @click="addressEdit">
             <img src="../static/imgs/icon_address.png" class="icon-address" />
-            <div class="info flex-col">
+            <div class="info flex-col" v-if="settlementInfo.customerAddress">
+                <div class="name f15 text1">
+                    {{ settlementInfo.customerAddress.name }}&nbsp;&nbsp;{{ settlementInfo.customerAddress.mobile }}
+                </div>
+                <div class="desc f12 text3">
+                    {{ settlementInfo.customerAddress.address }}&nbsp;{{ settlementInfo.customerAddress.detailAddress }}
+                </div>
+            </div>
+            <div class="info flex-col" v-else>
                 <div class="name f15 text1">请添加购车人</div>
                 <div class="desc f12 text3">请添加购车人</div>
             </div>
@@ -16,12 +24,12 @@
         <div class="product-info">
             <div class="title">
                 <img src="../static/imgs/icon_shop.png" class="icon" />
-                <div class="content">商城自营</div>
+                <div class="content">{{ storeName }}</div>
             </div>
             <div class="sku">
-                <img mode="aspectFill" src="https://shopimg.jetour.com.cn/20190830/1567151848634.jpg" class="cover" />
+                <img mode="aspectFill" :src="normalSku.image" class="cover" />
                 <div class="name">
-                    [整车订金]全新一代捷途X90 全球首发 限量预售
+                    {{ normalSku.name }}
                 </div>
                 <div class="amount">×1</div>
             </div>
@@ -32,31 +40,140 @@
                 </div>
                 <div class="row" style="margin-top: 20px; align-items: flex-start; height: 60px;">
                     <div class="label">订单备注</div>
-                    <textarea class="value" placeholder="请填写订单备注" maxlength="200" />
+                    <textarea class="value" placeholder="请填写订单备注" maxlength="200" v-model="remark" />
                 </div>
             </div>
             <div class="sum f12 text3">
-                共一件&nbsp;<span class="f14 text1">小计:<span class="price">¥90.00</span></span>
+                共一件&nbsp;<span class="f14 text1">
+                    小计:<span class="price">¥{{ settlementInfo.orderTotalPrice }}</span>
+                </span>
             </div>
         </div>
         <div class="bottom">
             <div class="sum f12 text3">
-                共一件&nbsp;<span class="f14 text1">小计:<span class="price">¥90.00</span></span>
+                共一件&nbsp;<span class="f14 text1"
+                    >小计:<span class="price">¥{{ settlementInfo.orderTotalPrice }}</span></span
+                >
             </div>
-            <div class="btn">提交订单</div>
+            <div class="btn" @click="submit">提交订单</div>
         </div>
+
+        <van-dialog id="van-dialog" />
     </div>
 </template>
 <script>
+import Dialog from '../vant/dialog/dialog';
 export default {
     data() {
-        return {};
+        return {
+            skuInfo: {},
+            settlementInfo: {},
+            addressId: null,
+            remark: ''
+        };
+    },
+    created() {
+        let skuInfo = this.$mp.query;
+        skuInfo.name = decodeURIComponent(skuInfo.name);
+        skuInfo.image = decodeURIComponent(skuInfo.image);
+        this.skuInfo = skuInfo;
+        console.log(skuInfo);
+        this.settlement();
+    },
+    computed: {
+        storeName() {
+            return (((this.settlementInfo.storeSettlements || [])[0] || {}).shoppingCartResponse || {}).storeName;
+        },
+        normalSku() {
+            return (
+                ((((this.settlementInfo.storeSettlements || [])[0] || {}).shoppingCartResponse || {}).normalSkus ||
+                    [])[0] || {}
+            );
+        }
     },
     methods: {
+        settlement() {
+            this.$http
+                .get('/applets/settlement', {
+                    addressId: this.addressId || '',
+                    skuInfo: this.skuInfo.skuId + ',1',
+                    isGroup: 0,
+                    ids: ''
+                })
+                .then(res => {
+                    if (res.data && res.data.storeSettlements) {
+                        this.settlementInfo = res.data;
+                    }
+                });
+        },
         addressEdit() {
             wx.navigateTo({
-                url: '/pages/addressEdit'
+                url: '/pages/addressList?pick=true',
+                events: {
+                    pickAddress: data => {
+                        this.addressId = data.id;
+                        this.settlement();
+                    }
+                }
+            });
+        },
+        submit() {
+            if (!this.addressId && !this.settlementInfo.customerAddress) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请先添加购车人'
+                });
+                return;
+            }
+            Dialog.alert({
+                message: '收获地址请填写真实购车人姓名和手机号,否则会影响权益领取!',
+                showCancelButton: true,
+                cancelButtonText: '关闭',
+                className: 'custom-class-name'
+            }).then(_ => {
+                wx.showLoading({
+                    mask: true,
+                    title: ''
+                });
+                this.$http
+                    .post(
+                        '/applets/submitorder',
+                        {
+                            addressId: this.addressId || (this.settlementInfo.customerAddress || {}).id,
+                            incomingUrl: this.$http.parseUrl('/applets/'),
+                            storeInfos: [
+                                {
+                                    storeId: 0,
+                                    payType: 0,
+                                    remark: this.remark,
+                                    usePoints: 0
+                                }
+                            ],
+                            ids: [],
+                            skuInfo: this.skuInfo.skuId + ',1',
+                            redEnvelopeCode: null,
+                            isGroup: 0,
+                            groupId: null,
+                            dealerIdStr:
+                                this.skuInfo.provinceId + '-' + this.skuInfo.cityId + '-' + this.skuInfo.dealerId,
+                            dealerId: this.skuInfo.dealerId,
+                            dealerInfo: ''
+                        },
+                        { header: { 'Content-Type': 'application/json' } }
+                    )
+                    .then(res => {
+                        wx.hideLoading();
+                        wx.showToast({
+                            title: '下单成功'
+                        });
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        wx.hideLoading();
+                    });
             });
+            return;
+            // eslint-disable-next-line no-unreachable
         }
     }
 };
@@ -188,4 +305,9 @@ page {
         justify-content: center;
     }
 }
+.dialog-index--custom-class-name {
+    .dialog-index--van-dialog__confirm {
+        color: @prim !important;
+    }
+}
 </style>

+ 49 - 0
src/pages/testDrive.vue

@@ -248,6 +248,55 @@ export default {
             this.cityId = value.id;
             this.cityName = value.name;
             this.showCityDialog = false;
+        },
+        getDealer() {
+            this.$http
+                .post(
+                    'https://dealer.jetour.com.cn/api-dealer/dealer-info/searchDealerListByCondition',
+                    {
+                        brandId: '0cbe50af-c29a-4eb0-91cc-4a05c5f05c57',
+                        provinceId: this.provinceId,
+                        cityId: this.cityId,
+                        enabledFlag: 1,
+                        type: 1
+                    },
+                    {
+                        header: {
+                            Authorization: '',
+                            'Content-Type': 'application/json'
+                        }
+                    }
+                )
+                .then(res => {
+                    res.data = res.data.filter(
+                        i => i.showWebsiteFlag == 1 && !(typeof i.code === 'string' && i.code.startsWith('99999'))
+                    );
+                    this.dealerList = res.data;
+                });
+        },
+        chooseDealer() {
+            if (!this.provinceId) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请先选择省份'
+                });
+                return;
+            }
+            if (!this.provinceId) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请先选择城市'
+                });
+                return;
+            }
+            this.getDealer();
+            this.showDealerDialog = true;
+        },
+        confirmDealer() {
+            let value = this.$mp.page.selectComponent('#dealerPicker').getColumnValue(0);
+            this.dealerName = value.name;
+            this.dealerId = value.id;
+            this.showDealerDialog = false;
         }
     },
     watch: {

+ 2 - 2
src/pages/tuxiang.vue

@@ -241,7 +241,7 @@ page {
 }
 .event-item {
     background: #ffffff;
-    border-radius: 4px 4px 0px 0px;
+    border-radius: 4px;
     margin: 10px 20px 0 20px;
     padding-bottom: 15px;
     overflow: hidden;
@@ -263,7 +263,7 @@ page {
 }
 .video-item {
     background: #ffffff;
-    border-radius: 4px 4px 0px 0px;
+    border-radius: 4px;
     margin: 10px 20px 0 20px;
     padding-bottom: 20px;
     overflow: hidden;

TEMPAT SAMPAH
src/static/imgs/icon_dropdown.png


TEMPAT SAMPAH
src/static/imgs/minus.png


TEMPAT SAMPAH
src/static/imgs/plus.png


+ 1 - 0
src/styles/common.less

@@ -10,6 +10,7 @@
 @border2: #e4e7ed;
 @border3: #ebeef5;
 @border4: #f2f6fc;
+@border5:#DEE6EF;
 @bg: #f2f4f5;
 @bg2:#F8FAFF;
 .flex() {