张延森 4 anni fa
parent
commit
8eb5461b88

+ 15
- 0
.eslintrc.js Vedi File

@@ -0,0 +1,15 @@
1
+module.exports = {
2
+  root: true,
3
+  env: {
4
+    node: true,
5
+  },
6
+  extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/prettier"],
7
+  parserOptions: {
8
+    parser: "babel-eslint",
9
+  },
10
+  rules: {
11
+    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12
+    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
13
+    "no-unused-vars": "warn",
14
+  },
15
+};

+ 3
- 0
.prettierrc.js Vedi File

@@ -0,0 +1,3 @@
1
+module.exports = {
2
+  semi: false,
3
+}

+ 2
- 17
package.json Vedi File

@@ -25,23 +25,8 @@
25 25
     "eslint": "^6.7.2",
26 26
     "eslint-plugin-vue": "^7.0.0",
27 27
     "less": "^3.12.2",
28
-    "less-loader": "^7.1.0"
29
-  },
30
-  "eslintConfig": {
31
-    "root": true,
32
-    "env": {
33
-      "node": true
34
-    },
35
-    "extends": [
36
-      "plugin:vue/vue3-essential",
37
-      "eslint:recommended"
38
-    ],
39
-    "parserOptions": {
40
-      "parser": "babel-eslint"
41
-    },
42
-    "rules": {
43
-      "no-unused-vars": "warn"
44
-    }
28
+    "less-loader": "^7.1.0",
29
+    "prettier": "^2.2.1"
45 30
   },
46 31
   "browserslist": [
47 32
     "> 1%",

+ 9
- 8
src/view/followup/index.vue Vedi File

@@ -57,8 +57,8 @@
57 57
           { pattern, message: '记录必须包含汉字' },
58 58
         ]"
59 59
       />
60
-      <div style="margin: 16px;">
61
-        <van-button round block type="primary" native-type="submit">
60
+      <div style="margin: 1em">
61
+        <van-button block type="warning" native-type="submit">
62 62
           提交
63 63
         </van-button>
64 64
       </div>
@@ -85,9 +85,6 @@ export default {
85 85
     Picker: Picker,
86 86
     // Secondhand:secondhand,
87 87
   },
88
-  data() {
89
-    return {};
90
-  },
91 88
   setup() {
92 89
     const router = useRouter();
93 90
     const roomId = router.currentRoute.value.query.roomId;
@@ -127,8 +124,8 @@ export default {
127 124
       request({
128 125
         url: "/room/follow/save",
129 126
         data: formData,
130
-      }).then(() => {
131
-  
127
+        toast: '请稍候...'
128
+      }).then(() => {  
132 129
         alert("添加成功").then(() => {
133 130
           router.go(-1);
134 131
         });
@@ -154,4 +151,8 @@ export default {
154 151
 </script>
155 152
 
156 153
 <!-- Add "scoped" attribute to limit CSS to this component only -->
157
-<style lang="less" scoped></style>
154
+<style lang="less" scoped>
155
+.closehouse {
156
+  padding-top: 1em;
157
+}
158
+</style>

+ 38
- 80
src/view/look/index.vue Vedi File

@@ -55,18 +55,18 @@
55 55
           { pattern, message: '记录必须包含汉字' },
56 56
         ]"
57 57
       />
58
- <!-- :before-delete="handleDelete" -->
58
+      <!-- :before-delete="handleDelete" -->
59 59
       <van-field name="followImg" label="上传图片">
60 60
         <template #input>
61 61
           <van-uploader
62 62
             v-model="imgUrl"
63 63
             :after-read="handleUpload"
64
-          :max-count="1"
64
+            :max-count="1"
65 65
           />
66 66
         </template>
67 67
       </van-field>
68
-      <div style="margin: 16px;">
69
-        <van-button round block type="primary" native-type="submit">
68
+      <div style="margin: 16px">
69
+        <van-button block type="warning" native-type="submit">
70 70
           提交
71 71
         </van-button>
72 72
       </div>
@@ -75,7 +75,7 @@
75 75
 </template>
76 76
 
77 77
 <script>
78
-import { reactive, ref, onMounted } from "vue";
78
+import { reactive, ref, onMounted } from "vue"
79 79
 import {
80 80
   Form,
81 81
   Button,
@@ -84,11 +84,10 @@ import {
84 84
   Popup,
85 85
   DatetimePicker,
86 86
   Uploader,
87
-} from "vant";
88
-import { useRouter } from "vue-router";
89
-import { useModel } from "@zjxpcyc/vue-tiny-store";
90
-import uploadImage from '@/utils/uploadImage'
91
-
87
+} from "vant"
88
+import { useRouter } from "vue-router"
89
+import { useModel } from "@zjxpcyc/vue-tiny-store"
90
+import uploadImage from "@/utils/uploadImage"
92 91
 
93 92
 export default {
94 93
   name: "lookrecord",
@@ -103,91 +102,46 @@ export default {
103 102
 
104 103
     // Secondhand:secondhand,
105 104
   },
106
-  data() {
107
-    return {};
108
-  },
109 105
   setup() {
110
-    const router = useRouter();
111
-    const roomId = router.currentRoute.value.query.roomId;
112
-    const showTimePicker = ref(false);
113
-    const imgUrl = ref([]);
114
-    
115
-    const { detail, getDetail } = useModel("room");
106
+    const router = useRouter()
107
+    const roomId = router.currentRoute.value.query.roomId
108
+    const showTimePicker = ref(false)
109
+    const imgUrl = ref([])
110
+
111
+    const { detail, getDetail } = useModel("room")
116 112
     const formData = reactive({
117 113
       roomId: roomId,
118 114
       followType: 0, //根据类型
119 115
       followTime: new Date(), //看房时间
120 116
       followDesc: undefined, //根进描述
121 117
       followImg: undefined, //图片
122
-    });
123
-    const pattern = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
118
+    })
119
+    const pattern = /[\u4E00-\u9FA5\uF900-\uFA2D]/
124 120
 
125 121
     const onSubmit = () => {
126
-      console.log("submit", formData);
127
-    };
122
+      console.log("submit", formData)
123
+    }
128 124
 
129 125
     const onConfirm = (value) => {
130
-      console.log(value, "value");
131
-      formData.followTime = value;
132
-      showTimePicker.value = false;
133
-    };
126
+      console.log(value, "value")
127
+      formData.followTime = value
128
+      showTimePicker.value = false
129
+    }
134 130
 
135
-    const handleUpload = file => {
131
+    const handleUpload = (file) => {
136 132
       if (file && file.file) {
137
-       console.log(file, )
138
-uploadImage(file.file, '', 1).then((url) => {
139
-        // const img = {
140
-        //   roomId,
141
-        //   url,
142
-        //   imgType: type,
143
-        //   sort,
144
-        // };
145
-        
146
-    
147
-        console.log(url,'url')
148
-        formData.followImg=url
149
-        imgUrl.value=[{url:url}]
150
-        // willSave.value.push(img);
151
-        // initData.value = {
152
-        //   ...initData.value,
153
-        //   rescList: {
154
-        //     ...(initData.value.rescList || {}),
155
-        //     [type]: (initData.value.rescList[type] || []).concat(img),
156
-        //   },
157
-        // };
158
-      });
159
-
160
-
133
+        uploadImage(file.file, "", 1).then((url) => {
134
+          formData.followImg = url
135
+          imgUrl.value = [{ url: url }]
136
+        })
161 137
       }
162
-      // const sort =
163
-      //   (initData.value.rescList[type] || []).length +
164
-      //   willSave.value.filter((x) => x.imgType === type).length;
165
-
166
-      // uploadImage(file, "1").then((url) => {
167
-      //   // const img = {
168
-      //   //   roomId,
169
-      //   //   url,
170
-      //   //   imgType: type,
171
-      //   //   sort,
172
-      //   // };
173
-      //   url;
174
-      //   type;
175
-      //   // willSave.value.push(img);
176
-      //   // initData.value = {
177
-      //   //   ...initData.value,
178
-      //   //   rescList: {
179
-      //   //     ...(initData.value.rescList || {}),
180
-      //   //     [type]: (initData.value.rescList[type] || []).concat(img),
181
-      //   //   },
182
-      //   // };
183
-      // });
184
-    };
138
+    }
185 139
 
186 140
     onMounted(() => {
187 141
       if (!detail.roomInfo) {
188
-        getDetail(roomId);
142
+        getDetail(roomId)
189 143
       }
190
-    });
144
+    })
191 145
 
192 146
     return {
193 147
       detail,
@@ -198,10 +152,14 @@ uploadImage(file.file, '', 1).then((url) => {
198 152
       showTimePicker,
199 153
       handleUpload,
200 154
       imgUrl,
201
-    };
155
+    }
202 156
   },
203
-};
157
+}
204 158
 </script>
205 159
 
206 160
 <!-- Add "scoped" attribute to limit CSS to this component only -->
207
-<style lang="less" scoped></style>
161
+<style lang="less" scoped>
162
+.lookrecord {
163
+  padding-top: 1em;
164
+}
165
+</style>

+ 5
- 24
src/view/secondhand/components/secondhandcard/index.vue Vedi File

@@ -5,7 +5,7 @@
5 5
         <van-image
6 6
           width="120"
7 7
           height="96"
8
-          :src="data.imgUrl || 'https://img.yzcdn.cn/vant/empty-image-default.png'"
8
+          :src="data.imgUrl"
9 9
         />
10 10
       </div>
11 11
       <div class="card-right">
@@ -161,6 +161,7 @@
161 161
 </template>
162 162
 
163 163
 <script>
164
+import { computed } from 'vue';
164 165
 import { cell, Image as VanImage, Tag } from "vant";
165 166
 
166 167
 export default {
@@ -178,19 +179,7 @@ export default {
178 179
   },
179 180
 
180 181
   setup(props) {
181
-    // const {datas={}} =
182
-    console.log(props);
183
-    // const {
184
-    //   title,
185
-    //   roomType,
186
-    //   acreage,
187
-    //   roomFloor,
188
-    //   aspect,
189
-    //   recordTime,
190
-    //   recordName,
191
-    //   belongName,
192
-    // } = props.datas;
193
-    const data = {
182
+    const data = computed(() => ({
194 183
       title: props.datas.estateName, //标题
195 184
       roomType: props.datas.roomType.split(","), //户型
196 185
       acreage: Number(props.datas.acreage || 0).toFixed(2), //面积
@@ -204,19 +193,11 @@ export default {
204 193
       unitPrice: Number(
205 194
         (props.datas.totalPrice * 10000) / props.datas.acreage || 0
206 195
       ).toFixed(2),
207
-    };
208
-
209
-    // const tag = ()=>{
210
-
211
-    // }
212
-
213
-    const toDetail = () => {
214
-      console.log("222");
215
-    };
196
+      imgUrl: props.datas.imgUrl || 'https://img.yzcdn.cn/vant/empty-image-default.png',
197
+    }))
216 198
 
217 199
     return {
218 200
       data,
219
-      toDetail,
220 201
     };
221 202
   },
222 203
 };

+ 5
- 2
src/view/secondhand/detail/components/Follow.vue Vedi File

@@ -14,11 +14,14 @@
14 14
       </van-step>
15 15
     </van-steps>
16 16
     <van-button
17
+      block
17 18
       size="small"
18
-      type="primary"
19
+      type="warning"
19 20
       v-shiro="'room:info:addFollow'"
20 21
       @click="goToAddFollow"
21
-      >添加跟进</van-button
22
+    >
23
+      添加跟进
24
+    </van-button
22 25
     >
23 26
   </x-loading>
24 27
 </template>

+ 5
- 3
src/view/secondhand/detail/components/Look.vue Vedi File

@@ -15,13 +15,15 @@
15 15
         </p>          
16 16
       </van-step>
17 17
     </van-steps>
18
-        <van-button
18
+    <van-button
19
+      block
19 20
       size="small"
20
-      type="primary"
21
+      type="warning"
21 22
       v-shiro="'room:info:addFollow'"
22 23
       @click="goToAddLook"
23
-      >添加空看</van-button
24 24
     >
25
+      添加空看
26
+    </van-button>
25 27
   </x-loading>
26 28
 </template>
27 29
 

+ 5
- 0
yarn.lock Vedi File

@@ -6820,6 +6820,11 @@ prettier@^1.18.2:
6820 6820
   resolved "https://registry.npm.taobao.org/prettier/download/prettier-1.19.1.tgz?cache=0&sync_timestamp=1606521077298&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
6821 6821
   integrity sha1-99f1/4qc2HKnvkyhQglZVqYHl8s=
6822 6822
 
6823
+prettier@^2.2.1:
6824
+  version "2.2.1"
6825
+  resolved "https://registry.npm.taobao.org/prettier/download/prettier-2.2.1.tgz?cache=0&sync_timestamp=1606523097359&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
6826
+  integrity sha1-eVoaeN1S8HPaDNQrIfnJE4GSP/U=
6827
+
6823 6828
 pretty-error@^2.0.2:
6824 6829
   version "2.1.2"
6825 6830
   resolved "https://registry.npm.taobao.org/pretty-error/download/pretty-error-2.1.2.tgz?cache=0&sync_timestamp=1609589403098&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpretty-error%2Fdownload%2Fpretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6"