panhui vor 5 Jahren
Ursprung
Commit
f7c41a3865

+ 7 - 0
project.config.json

@@ -113,6 +113,13 @@
                     "pathName": "pagesNews/Submit",
                     "query": "infoId=23151&activityId=26963",
                     "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "新闻资讯",
+                    "pathName": "pagesNews/News",
+                    "query": "type=INDUSTRY_NEWS",
+                    "scene": null
                 }
             ]
         }

+ 5 - 1
src/components/News/Grid.vue

@@ -12,7 +12,11 @@
                 <div class="text">{{ info.date }}</div>
             </div>
 
-            <div class="btn">
+            <div class="btn" v-if="info.del">
+                <van-button :color="$colors.warn" :radius="4" disabled>活动已取消</van-button>
+            </div>
+
+            <div class="btn" v-else>
                 <van-button
                     class="cancel"
                     type="primary"

+ 1 - 1
src/components/filter/Country.vue

@@ -229,7 +229,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/filter/EnterpriseType.vue

@@ -182,7 +182,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/filter/ProductBrand.vue

@@ -158,7 +158,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 2 - 2
src/components/filter/ProductCategory.vue

@@ -209,7 +209,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;
@@ -223,7 +223,7 @@ export default {
             }
         }
         .filterInfoTitle {
-            padding: 0px 0 10px;
+            padding: 0px 0 12px;
         }
     }
     &.filter--small {

+ 1 - 1
src/components/filter/ProductCustomCateId.vue

@@ -151,7 +151,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/filter/ProductTags.vue

@@ -197,7 +197,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/select/Application.vue

@@ -173,7 +173,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 12px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/select/Country.vue

@@ -237,7 +237,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/select/Industry.vue

@@ -185,7 +185,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/select/ProductCategory.vue

@@ -195,7 +195,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/components/select/ProductCategoryOnly.vue

@@ -190,7 +190,7 @@ export default {
 }
 .filterInfo {
     &.filter--big {
-        padding: 0 16px 20px;
+        padding: 0 16px 32px;
         .filter-btn {
             height: 44px;
             padding: 0 16px;

+ 1 - 1
src/pagesHome/Brand.vue

@@ -116,7 +116,7 @@ export default {
             main: null,
             top: null,
             vendors: [],
-            url: '/vendorInfo/show',
+            url: '/vendorInfo/show1',
             barTop: 0,
             ratio: 0,
             categoryIds: '',

+ 6 - 2
src/pagesHome/Edit.vue

@@ -71,7 +71,7 @@
                 is-link
                 :value="myInfo.userEmail || '未填写'"
                 :value-class="myInfo.userEmail ? '' : 'noValue'"
-                @click="navigateTo('/pagesMine/ChangeEmail')"
+                @click="navigateTo('/pagesMine/ChangeEmail?type=edit', false)"
             />
         </van-cell-group>
 
@@ -127,7 +127,7 @@ export default {
     },
     onShow() {
         this.$nextTick(() => {
-            if (this.myInfo.userEmail !== this.userInfo.email) {
+            if (this.userInfo.email && this.myInfo.userEmail !== this.userInfo.email) {
                 this.myInfo.userEmail = this.userInfo.email;
             }
         });
@@ -287,6 +287,10 @@ export default {
         setImg(src) {
             console.log(src);
             this.myInfo.logo = src;
+        },
+        setEmail(email) {
+            console.log(email);
+            this.myInfo.userEmail = email;
         }
     }
 };

+ 11 - 12
src/pagesHome/FilterPage.vue

@@ -5,7 +5,7 @@
 }
 </config>
 <template>
-    <div class="pageBottom">
+    <div class="pageBottom filiterPage">
         <product-customCateId-filter
             v-model="customCateId"
             :list="customCateList"
@@ -19,16 +19,10 @@
         <enterprise-type v-model="enterpriseType" v-if="pageType === 'vendor'"></enterprise-type>
         <application v-model="applicationField"></application>
 
-        <div class="fixed-bottom">
-            <div class="btn-list">
-                <div class="btn-block">
-                    <van-button type="default" block @click="restart">重置</van-button>
-                </div>
-                <div class="btn-block">
-                    <van-button :color="$colors.warn" @click="submit" block>确定</van-button>
-                </div>
-            </div>
-        </div>
+        <fixed-button btnList>
+            <van-button type="default" block @click="restart">重置</van-button>
+            <van-button :color="$colors.warn" @click="submit" block>确定</van-button>
+        </fixed-button>
     </div>
 </template>
 <script>
@@ -39,6 +33,7 @@ import Application from '../components/filter/Application';
 import EnterpriseType from '../components/filter/EnterpriseType';
 import ProductBrand from '../components/filter/ProductBrand.vue';
 import ProductCustomCateIdFilter from '../components/filter/ProductCustomCateId.vue';
+import FixedButton from '../components/FixedButton.vue';
 export default {
     data() {
         return {
@@ -95,7 +90,8 @@ export default {
         Application,
         EnterpriseType,
         ProductBrand,
-        ProductCustomCateIdFilter
+        ProductCustomCateIdFilter,
+        FixedButton
     },
     methods: {
         restart() {
@@ -133,6 +129,9 @@ export default {
 };
 </script>
 <style lang="less">
+.filiterPage {
+    padding-top: 12px;
+}
 .fixed-bottom {
     height: 60px;
 }

+ 8 - 0
src/pagesHome/Search.vue

@@ -418,9 +418,17 @@ export default {
             text-overflow: ellipsis;
             white-space: nowrap;
             word-wrap: normal;
+            display: flex;
+            align-items: center;
             span {
                 font-weight: bold;
                 color: #292c33;
+                max-width: 160px;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                word-wrap: normal;
+                display: block;
             }
 
             .important {

+ 31 - 19
src/pagesMine/ChangeEmail.vue

@@ -33,7 +33,8 @@ import { mapState } from 'vuex';
 export default {
     data() {
         return {
-            email: ''
+            email: '',
+            isEdit: false
         };
     },
     computed: {
@@ -46,10 +47,15 @@ export default {
             }
         }
     },
+    onLoad(options) {
+        if (options.type === 'edit') {
+            this.isEdit = true;
+        }
+    },
     methods: {
         submit() {
             if (!this.email) {
-                this.toast('请输入密码');
+                this.toast('请输入邮箱');
                 return;
             }
             if (!emailRule.test(this.email)) {
@@ -57,25 +63,31 @@ export default {
                 return;
             }
 
-            this.$http
-                .post(
-                    '/buyersInfo/saveVO',
-                    {
-                        ...this.userMoreInfo,
-                        userEmail: this.email
-                    },
-                    {
-                        header: {
-                            'Content-Type': 'application/json'
+            if (this.isEdit) {
+                var pages = getCurrentPages();
+                pages[pages.length - 2].rootVM.setEmail(this.email);
+                this.navigateBack();
+            } else {
+                this.$http
+                    .post(
+                        '/buyersInfo/saveVO',
+                        {
+                            ...this.userMoreInfo,
+                            userEmail: this.email
+                        },
+                        {
+                            header: {
+                                'Content-Type': 'application/json'
+                            }
                         }
-                    }
-                )
-                .then(res => {
-                    this.toast('绑定成功', 'success');
-                    this.$store.dispatch('getUserInfo').then(() => {
-                        this.navigateBack();
+                    )
+                    .then(res => {
+                        this.toast('绑定成功', 'success');
+                        this.$store.dispatch('getUserInfo').then(() => {
+                            this.navigateBack();
+                        });
                     });
-                });
+            }
         }
     }
 };

+ 3 - 2
src/pagesMine/ReadRecords.vue

@@ -40,7 +40,7 @@ export default {
             type: 'PRODUCT',
             chooseList: [],
             isEdit: false,
-            noSearch: true
+            noSearch: false
         };
     },
     computed: {
@@ -48,7 +48,8 @@ export default {
         listQuery() {
             return {
                 type: this.type,
-                isCollect: false
+                isCollect: false,
+                del: false
             };
         }
     },

+ 3 - 1
src/pagesNews/Detail.vue

@@ -116,7 +116,7 @@ export default {
                     {
                         query: {
                             userId: this.$store.state.userInfo.id,
-                            informationId: this.$mp.options.informationId,
+                            informationId: this.$mp.options.id,
                             del: false
                         }
                     },
@@ -129,6 +129,8 @@ export default {
                 .then(res => {
                     if (!res.empty) {
                         this.activityId = res.content[0].id;
+                    } else {
+                        this.activityId = 0;
                     }
                 });
         }

+ 13 - 2
src/pagesNews/News.vue

@@ -96,8 +96,19 @@ export default {
             return this.$t([...this.informations][this.hotActive].name);
         }
     },
-    onLoad() {
-        this.changeTab(0, true);
+    onLoad(options) {
+        this.$nextTick(() => {
+            let index = 0;
+            if (options.type) {
+                index = [...this.informations].findIndex(item => {
+                    return item.key === options.type;
+                });
+                if (index === -1) {
+                    index = 0;
+                }
+            }
+            this.changeTab(index, true);
+        });
     },
     methods: {
         changeTab(index, first = false) {

+ 21 - 11
src/pagesNews/Submit.vue

@@ -41,38 +41,38 @@
             <van-cell-group :border="false">
                 <van-field
                     label="姓名"
-                    :value="form.nickname"
+                    :value="newForm.nickname"
                     input-align="right"
                     @input="form.nickname = $event.detail"
-                    :readonly="activityId"
+                    :readonly="!!activityId"
                 />
                 <van-field label="称呼" :value="getSexName(form.sex)" input-align="right" readonly @click="chooseSex" />
                 <van-field
                     label="公司名称"
-                    :value="form.companyName"
+                    :value="newForm.companyName"
                     input-align="right"
                     @input="form.companyName = $event.detail"
-                    :readonly="activityId"
+                    :readonly="!!activityId"
                 />
                 <van-field
                     label="职位"
-                    :value="form.position"
+                    :value="newForm.position"
                     input-align="right"
                     @input="form.position = $event.detail"
-                    :readonly="activityId"
+                    :readonly="!!activityId"
                 />
                 <van-field
                     label="电话"
-                    :value="form.phone"
+                    :value="newForm.phone"
                     input-align="right"
-                    :readonly="activityId"
+                    :readonly="!!activityId"
                     @input="form.phone = $event.detail"
                 />
                 <van-field
                     label="邮箱"
-                    :value="form.email"
+                    :value="newForm.email"
                     input-align="right"
-                    :readonly="activityId"
+                    :readonly="!!activityId"
                     @input="form.email = $event.detail"
                 />
             </van-cell-group>
@@ -104,7 +104,15 @@ export default {
         return {
             information: {},
             chooseSession: '',
-            form: {},
+            form: {
+                nickname: '',
+                companyName: '',
+                position: '',
+                sex: '',
+                phone: '',
+                email: ''
+            },
+            newForm: {},
             activityId: 0
         };
     },
@@ -137,6 +145,7 @@ export default {
             this.$http.get('/eventRegistration/get/' + options.activityId).then(res => {
                 this.information = res.information;
                 this.form = { ...res };
+                this.newForm = { ...this.form };
             });
             wx.setNavigationBarTitle({
                 title: '报名表信息'
@@ -222,6 +231,7 @@ export default {
                     informationId: this.informationId,
                     session: this.getList(this.information.session)
                 };
+                this.newForm = { ...this.form };
             }
         },
         getSexName(sex) {