Commit 65b37b05650f2dbec79e833def25b42a542ed5e7
Merge remote-tracking branch 'origin/master'
# Conflicts: # pages.json # pages/advertisementDetail/advertisementDetail.vue # pages/details/details.vue # pages/questionnaire/questionnaire.vue # pages/record/record.scss # pages/record/record.vue
Showing
37 changed files
with
3874 additions
and
910 deletions
components/uni-forms-item/uni-forms-item.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="uni-forms-item" :class="{'uni-forms-item--border':border,'is-first-border':border&&isFirstBorder,'uni-forms-item-error':msg}"> | ||
| 3 | + <view class="uni-forms-item__inner" :class="['is-direction-'+labelPos,]"> | ||
| 4 | + <view v-if="label" class="uni-forms-item__label" :style="{width:labelWid+'px',justifyContent: justifyContent}"> | ||
| 5 | + <slot name="left"> | ||
| 6 | + <uni-icons v-if="leftIcon" class="label-icon" size="16" :type="leftIcon" :color="iconColor" /> | ||
| 7 | + <text>{{label}}</text> | ||
| 8 | + <text v-if="required" class="is-required">*</text> | ||
| 9 | + </slot> | ||
| 10 | + </view> | ||
| 11 | + <view class="uni-forms-item__content" :class="{'is-input-error-border': msg}"> | ||
| 12 | + <slot></slot> | ||
| 13 | + </view> | ||
| 14 | + </view> | ||
| 15 | + <view class="uni-error-message" :class="{'uni-error-msg--boeder':border}" :style="{ | ||
| 16 | + paddingLeft: (labelPos === 'left'? Number(labelWid)+5:5) + 'px' | ||
| 17 | + }">{{ showMsg === 'undertext' ? msg:'' }}</view> | ||
| 18 | + </view> | ||
| 19 | +</template> | ||
| 20 | + | ||
| 21 | +<script> | ||
| 22 | + /** | ||
| 23 | + * Field 输入框 | ||
| 24 | + * @description 此组件可以实现表单的输入与校验,包括 "text" 和 "textarea" 类型。 | ||
| 25 | + * @tutorial https://ext.dcloud.net.cn/plugin?id=21001 | ||
| 26 | + * @property {Boolean} required 是否必填,左边显示红色"*"号(默认false) | ||
| 27 | + * @property {String} validateTrigger = [bind|submit] 校验触发器方式 默认 submit 可选 | ||
| 28 | + * @value bind 发生变化时触发 | ||
| 29 | + * @value submit 提交时触发 | ||
| 30 | + * @property {String } leftIcon label左边的图标,限 uni-ui 的图标名称 | ||
| 31 | + * @property {String } iconColor 左边通过icon配置的图标的颜色(默认#606266) | ||
| 32 | + * @property {String } label 输入框左边的文字提示 | ||
| 33 | + * @property {Number } labelWidth label的宽度,单位px(默认65) | ||
| 34 | + * @property {String } labelAlign = [left|center|right] label的文字对齐方式(默认left) | ||
| 35 | + * @value left label 左侧显示 | ||
| 36 | + * @value center label 居中 | ||
| 37 | + * @value right label 右侧对齐 | ||
| 38 | + * @property {String } labelPosition = [top|left] label的文字的位置(默认left) | ||
| 39 | + * @value top 顶部显示 label | ||
| 40 | + * @value left 左侧显示 label | ||
| 41 | + * @property {String } errorMessage 显示的错误提示内容,如果为空字符串或者false,则不显示错误信息 | ||
| 42 | + * @property {String } name 表单域的属性名,在使用校验规则时必填 | ||
| 43 | + */ | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + | ||
| 47 | + export default { | ||
| 48 | + name: "uniFormsItem", | ||
| 49 | + props: { | ||
| 50 | + // 自定义内容 | ||
| 51 | + custom: { | ||
| 52 | + type: Boolean, | ||
| 53 | + default: false | ||
| 54 | + }, | ||
| 55 | + // 是否显示报错信息 | ||
| 56 | + showMessage: { | ||
| 57 | + type: Boolean, | ||
| 58 | + default: true | ||
| 59 | + }, | ||
| 60 | + name: String, | ||
| 61 | + required: Boolean, | ||
| 62 | + validateTrigger: { | ||
| 63 | + type: String, | ||
| 64 | + default: '' | ||
| 65 | + }, | ||
| 66 | + leftIcon: String, | ||
| 67 | + iconColor: { | ||
| 68 | + type: String, | ||
| 69 | + default: '#606266' | ||
| 70 | + }, | ||
| 71 | + label: String, | ||
| 72 | + // 左边标题的宽度单位px | ||
| 73 | + labelWidth: { | ||
| 74 | + type: [Number, String], | ||
| 75 | + default: '' | ||
| 76 | + }, | ||
| 77 | + // 对齐方式,left|center|right | ||
| 78 | + labelAlign: { | ||
| 79 | + type: String, | ||
| 80 | + default: '' | ||
| 81 | + }, | ||
| 82 | + // lable的位置,可选为 left-左边,top-上边 | ||
| 83 | + labelPosition: { | ||
| 84 | + type: String, | ||
| 85 | + default: '' | ||
| 86 | + }, | ||
| 87 | + errorMessage: { | ||
| 88 | + type: [String, Boolean], | ||
| 89 | + default: '' | ||
| 90 | + } | ||
| 91 | + }, | ||
| 92 | + data() { | ||
| 93 | + return { | ||
| 94 | + errorTop: false, | ||
| 95 | + errorBottom: false, | ||
| 96 | + labelMarginBottom: '', | ||
| 97 | + errorWidth: '', | ||
| 98 | + errMsg: '', | ||
| 99 | + val: '', | ||
| 100 | + labelPos: '', | ||
| 101 | + labelWid: '', | ||
| 102 | + labelAli: '', | ||
| 103 | + showMsg: 'undertext', | ||
| 104 | + border: false, | ||
| 105 | + isFirstBorder: false | ||
| 106 | + }; | ||
| 107 | + }, | ||
| 108 | + computed: { | ||
| 109 | + msg() { | ||
| 110 | + return this.errorMessage || this.errMsg; | ||
| 111 | + }, | ||
| 112 | + fieldStyle() { | ||
| 113 | + let style = {} | ||
| 114 | + if (this.labelPos == 'top') { | ||
| 115 | + style.padding = '0 0' | ||
| 116 | + this.labelMarginBottom = '6px' | ||
| 117 | + } | ||
| 118 | + if (this.labelPos == 'left' && this.msg !== false && this.msg != '') { | ||
| 119 | + style.paddingBottom = '0px' | ||
| 120 | + this.errorBottom = true | ||
| 121 | + this.errorTop = false | ||
| 122 | + } else if (this.labelPos == 'top' && this.msg !== false && this.msg != '') { | ||
| 123 | + this.errorBottom = false | ||
| 124 | + this.errorTop = true | ||
| 125 | + } else { | ||
| 126 | + // style.paddingBottom = '' | ||
| 127 | + this.errorTop = false | ||
| 128 | + this.errorBottom = false | ||
| 129 | + } | ||
| 130 | + return style | ||
| 131 | + }, | ||
| 132 | + | ||
| 133 | + // uni不支持在computed中写style.justifyContent = 'center'的形式,故用此方法 | ||
| 134 | + justifyContent() { | ||
| 135 | + if (this.labelAli === 'left') return 'flex-start'; | ||
| 136 | + if (this.labelAli === 'center') return 'center'; | ||
| 137 | + if (this.labelAli === 'right') return 'flex-end'; | ||
| 138 | + } | ||
| 139 | + }, | ||
| 140 | + watch: { | ||
| 141 | + validateTrigger(trigger) { | ||
| 142 | + this.formTrigger = trigger | ||
| 143 | + } | ||
| 144 | + }, | ||
| 145 | + created() { | ||
| 146 | + this.form = this.getForm() | ||
| 147 | + this.group = this.getForm('uniGroup') | ||
| 148 | + this.formRules = [] | ||
| 149 | + this.formTrigger = this.validateTrigger | ||
| 150 | + if (this.form) { | ||
| 151 | + this.form.childrens.push(this) | ||
| 152 | + } | ||
| 153 | + this.init() | ||
| 154 | + }, | ||
| 155 | + destroyed() { | ||
| 156 | + if (this.form) { | ||
| 157 | + this.form.childrens.forEach((item, index) => { | ||
| 158 | + if (item === this) { | ||
| 159 | + this.form.childrens.splice(index, 1) | ||
| 160 | + delete this.form.formData[item.name] | ||
| 161 | + } | ||
| 162 | + }) | ||
| 163 | + } | ||
| 164 | + }, | ||
| 165 | + methods: { | ||
| 166 | + init() { | ||
| 167 | + if (this.form) { | ||
| 168 | + let { | ||
| 169 | + formRules, | ||
| 170 | + validator, | ||
| 171 | + formData, | ||
| 172 | + value, | ||
| 173 | + labelPosition, | ||
| 174 | + labelWidth, | ||
| 175 | + labelAlign, | ||
| 176 | + errShowType | ||
| 177 | + } = this.form | ||
| 178 | + | ||
| 179 | + this.labelPos = this.labelPosition ? this.labelPosition : labelPosition | ||
| 180 | + this.labelWid = this.label ? (this.labelWidth ? this.labelWidth : labelWidth):0 | ||
| 181 | + this.labelAli = this.labelAlign ? this.labelAlign : labelAlign | ||
| 182 | + | ||
| 183 | + // 判断第一个 item | ||
| 184 | + if (!this.form.isFirstBorder) { | ||
| 185 | + this.form.isFirstBorder = true | ||
| 186 | + this.isFirstBorder = true | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + // 判断 group 里的第一个 item | ||
| 190 | + if (this.group) { | ||
| 191 | + if (!this.group.isFirstBorder) { | ||
| 192 | + this.group.isFirstBorder = true | ||
| 193 | + this.isFirstBorder = true | ||
| 194 | + } | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + this.border = this.form.border | ||
| 198 | + this.showMsg = errShowType | ||
| 199 | + | ||
| 200 | + if (formRules) { | ||
| 201 | + this.formRules = formRules[this.name] || {} | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + this.validator = validator | ||
| 205 | + } else { | ||
| 206 | + this.labelPos = this.labelPosition || 'left' | ||
| 207 | + this.labelWid = this.labelWidth || 65 | ||
| 208 | + this.labelAli = this.labelAlign || 'left' | ||
| 209 | + } | ||
| 210 | + }, | ||
| 211 | + /** | ||
| 212 | + * 获取父元素实例 | ||
| 213 | + */ | ||
| 214 | + getForm(name = 'uniForms') { | ||
| 215 | + let parent = this.$parent; | ||
| 216 | + let parentName = parent.$options.name; | ||
| 217 | + while (parentName !== name) { | ||
| 218 | + parent = parent.$parent; | ||
| 219 | + if (!parent) return false | ||
| 220 | + parentName = parent.$options.name; | ||
| 221 | + } | ||
| 222 | + return parent; | ||
| 223 | + }, | ||
| 224 | + | ||
| 225 | + /** | ||
| 226 | + * 移除该表单项的校验结果 | ||
| 227 | + */ | ||
| 228 | + clearValidate() { | ||
| 229 | + this.errMsg = '' | ||
| 230 | + }, | ||
| 231 | + | ||
| 232 | + setValue(value){ | ||
| 233 | + if (this.name) { | ||
| 234 | + if(this.errMsg) this.errMsg = '' | ||
| 235 | + this.form.formData[this.name] = this.form._getValue(this.name, value) | ||
| 236 | + if(!this.formRules || (typeof(this.formRules) && JSON.stringify(this.formRules) === '{}')) return | ||
| 237 | + this.triggerCheck(this.form._getValue(this.name, value)) | ||
| 238 | + } | ||
| 239 | + }, | ||
| 240 | + | ||
| 241 | + /** | ||
| 242 | + * 校验规则 | ||
| 243 | + * @param {Object} value | ||
| 244 | + */ | ||
| 245 | + async triggerCheck(value, callback) { | ||
| 246 | + let promise = null; | ||
| 247 | + this.errMsg = '' | ||
| 248 | + // if no callback, return promise | ||
| 249 | + // if (callback && typeof callback !== 'function' && Promise) { | ||
| 250 | + // promise = new Promise((resolve, reject) => { | ||
| 251 | + // callback = function(valid) { | ||
| 252 | + // !valid ? resolve(valid) : reject(valid) | ||
| 253 | + // }; | ||
| 254 | + // }); | ||
| 255 | + // } | ||
| 256 | + // if (!this.validator) { | ||
| 257 | + // typeof callback === 'function' && callback(null); | ||
| 258 | + // if (promise) return promise | ||
| 259 | + // } | ||
| 260 | + if (!this.validator) return | ||
| 261 | + const isNoField = this.isRequired(this.formRules.rules || []) | ||
| 262 | + let isTrigger = this.isTrigger(this.formRules.validateTrigger, this.validateTrigger, this.form.validateTrigger) | ||
| 263 | + let result = null | ||
| 264 | + if (!(!isTrigger)) { | ||
| 265 | + result = await this.validator.validateUpdate({ | ||
| 266 | + [this.name]: value | ||
| 267 | + }, this.form.formData) | ||
| 268 | + } | ||
| 269 | + // 判断是否必填 | ||
| 270 | + if (!isNoField && !value) { | ||
| 271 | + result = null | ||
| 272 | + } | ||
| 273 | + if (isTrigger && result && result.errorMessage) { | ||
| 274 | + const inputComp = this.form.inputChildrens.find(child => child.rename === this.name) | ||
| 275 | + if (inputComp) { | ||
| 276 | + inputComp.errMsg = result.errorMessage | ||
| 277 | + } | ||
| 278 | + if (this.form.errShowType === 'toast') { | ||
| 279 | + uni.showToast({ | ||
| 280 | + title: result.errorMessage || '校验错误', | ||
| 281 | + icon: 'none' | ||
| 282 | + }) | ||
| 283 | + } | ||
| 284 | + if (this.form.errShowType === 'modal') { | ||
| 285 | + uni.showModal({ | ||
| 286 | + title: '提示', | ||
| 287 | + content: result.errorMessage || '校验错误' | ||
| 288 | + }) | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + this.errMsg = !result ? '' : result.errorMessage | ||
| 293 | + // 触发validate事件 | ||
| 294 | + this.form.validateCheck(result ? result : null) | ||
| 295 | + // typeof callback === 'function' && callback(result ? result : null); | ||
| 296 | + // if (promise) return promise | ||
| 297 | + | ||
| 298 | + }, | ||
| 299 | + /** | ||
| 300 | + * 触发时机 | ||
| 301 | + * @param {Object} event | ||
| 302 | + */ | ||
| 303 | + isTrigger(rule, itemRlue, parentRule) { | ||
| 304 | + let rl = true; | ||
| 305 | + // bind submit | ||
| 306 | + if (rule === 'submit' || !rule) { | ||
| 307 | + if (rule === undefined) { | ||
| 308 | + if (itemRlue !== 'bind') { | ||
| 309 | + if (!itemRlue) { | ||
| 310 | + return parentRule === 'bind' ? true : false | ||
| 311 | + } | ||
| 312 | + return false | ||
| 313 | + } | ||
| 314 | + return true | ||
| 315 | + } | ||
| 316 | + return false | ||
| 317 | + } | ||
| 318 | + return true; | ||
| 319 | + }, | ||
| 320 | + // 是否有必填字段 | ||
| 321 | + isRequired(rules) { | ||
| 322 | + let isNoField = false | ||
| 323 | + for (let i = 0; i < rules.length; i++) { | ||
| 324 | + const ruleData = rules[i] | ||
| 325 | + if (ruleData.required) { | ||
| 326 | + isNoField = true | ||
| 327 | + break | ||
| 328 | + } | ||
| 329 | + } | ||
| 330 | + return isNoField | ||
| 331 | + } | ||
| 332 | + } | ||
| 333 | + }; | ||
| 334 | +</script> | ||
| 335 | + | ||
| 336 | +<style lang="scss" scoped> | ||
| 337 | + .uni-forms-item { | ||
| 338 | + position: relative; | ||
| 339 | + // padding: 16px 14px; | ||
| 340 | + text-align: left; | ||
| 341 | + color: #333; | ||
| 342 | + font-size: 14px; | ||
| 343 | + margin-bottom: 22px; | ||
| 344 | + background-color: #fff; | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + .uni-forms-item__inner { | ||
| 348 | + /* #ifndef APP-NVUE */ | ||
| 349 | + display: flex; | ||
| 350 | + /* #endif */ | ||
| 351 | + // flex-direction: row; | ||
| 352 | + // align-items: center; | ||
| 353 | + } | ||
| 354 | + | ||
| 355 | + .is-direction-left { | ||
| 356 | + flex-direction: row; | ||
| 357 | + } | ||
| 358 | + | ||
| 359 | + .is-direction-top { | ||
| 360 | + flex-direction: column; | ||
| 361 | + } | ||
| 362 | + | ||
| 363 | + .uni-forms-item__label { | ||
| 364 | + /* #ifndef APP-NVUE */ | ||
| 365 | + display: flex; | ||
| 366 | + flex-shrink: 0; | ||
| 367 | + /* #endif */ | ||
| 368 | + flex-direction: row; | ||
| 369 | + align-items: center; | ||
| 370 | + font-size: 14px; | ||
| 371 | + color: #333; | ||
| 372 | + width: 65px; | ||
| 373 | + // line-height: 2; | ||
| 374 | + // margin-top: 3px; | ||
| 375 | + padding: 5px 0; | ||
| 376 | + box-sizing: border-box; | ||
| 377 | + height: 36px; | ||
| 378 | + margin-right: 5px; | ||
| 379 | + } | ||
| 380 | + | ||
| 381 | + .uni-forms-item__content { | ||
| 382 | + /* #ifndef APP-NVUE */ | ||
| 383 | + width: 100%; | ||
| 384 | + // display: flex; | ||
| 385 | + /* #endif */ | ||
| 386 | + // flex: 1; | ||
| 387 | + // flex-direction: row; | ||
| 388 | + // align-items: center; | ||
| 389 | + box-sizing: border-box; | ||
| 390 | + min-height: 36px; | ||
| 391 | + } | ||
| 392 | + | ||
| 393 | + | ||
| 394 | + .label-icon { | ||
| 395 | + margin-right: 5px; | ||
| 396 | + margin-top: -1px; | ||
| 397 | + } | ||
| 398 | + | ||
| 399 | + // 必填 | ||
| 400 | + .is-required { | ||
| 401 | + color: $uni-color-error; | ||
| 402 | + } | ||
| 403 | + | ||
| 404 | + .uni-error-message { | ||
| 405 | + position: absolute; | ||
| 406 | + bottom: -17px; | ||
| 407 | + left: 0; | ||
| 408 | + line-height: 12px; | ||
| 409 | + color: $uni-color-error; | ||
| 410 | + font-size: 12px; | ||
| 411 | + text-align: left; | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + .uni-error-msg--boeder { | ||
| 415 | + position: relative; | ||
| 416 | + bottom: 0; | ||
| 417 | + line-height: 22px; | ||
| 418 | + } | ||
| 419 | + | ||
| 420 | + .is-input-error-border { | ||
| 421 | + border-color: $uni-color-error; | ||
| 422 | + } | ||
| 423 | + | ||
| 424 | + .uni-forms-item--border { | ||
| 425 | + margin-bottom: 0; | ||
| 426 | + padding: 10px 15px; | ||
| 427 | + // padding-bottom: 0; | ||
| 428 | + border-top: 1px #eee solid; | ||
| 429 | + } | ||
| 430 | + | ||
| 431 | + .uni-forms-item-error { | ||
| 432 | + padding-bottom: 0; | ||
| 433 | + } | ||
| 434 | + | ||
| 435 | + .is-first-border { | ||
| 436 | + border: none; | ||
| 437 | + } | ||
| 438 | +</style> |
components/uni-forms/uni-forms.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <!-- --> | ||
| 3 | + <view class="uni-forms" :class="{'uni-forms--top':!border}"> | ||
| 4 | + <form @submit.stop="submitForm" @reset="resetForm"> | ||
| 5 | + <slot></slot> | ||
| 6 | + </form> | ||
| 7 | + </view> | ||
| 8 | +</template> | ||
| 9 | + | ||
| 10 | +<script> | ||
| 11 | + /** | ||
| 12 | + * Forms 表单 | ||
| 13 | + * @description 由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据 | ||
| 14 | + * @tutorial https://ext.dcloud.net.cn/plugin?id=2773 | ||
| 15 | + * @property {Object} rules 表单校验规则 | ||
| 16 | + * @property {String} validateTrigger = [bind|submit] 校验触发器方式 默认 submit 可选 | ||
| 17 | + * @value bind 发生变化时触发 | ||
| 18 | + * @value submit 提交时触发 | ||
| 19 | + * @property {String} labelPosition = [top|left] label 位置 默认 left 可选 | ||
| 20 | + * @value top 顶部显示 label | ||
| 21 | + * @value left 左侧显示 label | ||
| 22 | + * @property {String} labelWidth label 宽度,默认 65px | ||
| 23 | + * @property {String} labelAlign = [left|center|right] label 居中方式 默认 left 可选 | ||
| 24 | + * @value left label 左侧显示 | ||
| 25 | + * @value center label 居中 | ||
| 26 | + * @value right label 右侧对齐 | ||
| 27 | + * @property {String} errShowType = [undertext|toast|modal] 校验错误信息提示方式 | ||
| 28 | + * @value undertext 错误信息在底部显示 | ||
| 29 | + * @value toast 错误信息toast显示 | ||
| 30 | + * @value modal 错误信息modal显示 | ||
| 31 | + * @event {Function} submit 提交时触发 | ||
| 32 | + */ | ||
| 33 | + import Vue from 'vue' | ||
| 34 | + Vue.prototype.binddata = function(name, value, formName) { | ||
| 35 | + if (formName) { | ||
| 36 | + this.$refs[formName].setValue(name, value) | ||
| 37 | + } else { | ||
| 38 | + let formVm | ||
| 39 | + for (let i in this.$refs) { | ||
| 40 | + const vm = this.$refs[i] | ||
| 41 | + if (vm && vm.$options && vm.$options.name === 'uniForms') { | ||
| 42 | + formVm = vm | ||
| 43 | + break | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + if (!formVm) return console.error('当前 uni-froms 组件缺少 ref 属性') | ||
| 47 | + formVm.setValue(name, value) | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + import Validator from './validate.js' | ||
| 52 | + | ||
| 53 | + export default { | ||
| 54 | + name: 'uniForms', | ||
| 55 | + props: { | ||
| 56 | + value: { | ||
| 57 | + type: Object, | ||
| 58 | + default () { | ||
| 59 | + return {} | ||
| 60 | + } | ||
| 61 | + }, | ||
| 62 | + // 表单校验规则 | ||
| 63 | + rules: { | ||
| 64 | + type: Object, | ||
| 65 | + default () { | ||
| 66 | + return {} | ||
| 67 | + } | ||
| 68 | + }, | ||
| 69 | + // 校验触发器方式,默认 关闭 | ||
| 70 | + validateTrigger: { | ||
| 71 | + type: String, | ||
| 72 | + default: '' | ||
| 73 | + }, | ||
| 74 | + // label 位置,可选值 top/left | ||
| 75 | + labelPosition: { | ||
| 76 | + type: String, | ||
| 77 | + default: 'left' | ||
| 78 | + }, | ||
| 79 | + // label 宽度,单位 px | ||
| 80 | + labelWidth: { | ||
| 81 | + type: [String, Number], | ||
| 82 | + default: 65 | ||
| 83 | + }, | ||
| 84 | + // label 居中方式,可选值 left/center/right | ||
| 85 | + labelAlign: { | ||
| 86 | + type: String, | ||
| 87 | + default: 'left' | ||
| 88 | + }, | ||
| 89 | + errShowType: { | ||
| 90 | + type: String, | ||
| 91 | + default: 'undertext' | ||
| 92 | + }, | ||
| 93 | + border: { | ||
| 94 | + type: Boolean, | ||
| 95 | + default: false | ||
| 96 | + } | ||
| 97 | + }, | ||
| 98 | + data() { | ||
| 99 | + return { | ||
| 100 | + formData: {} | ||
| 101 | + }; | ||
| 102 | + }, | ||
| 103 | + watch: { | ||
| 104 | + rules(newVal) { | ||
| 105 | + this.init(newVal) | ||
| 106 | + }, | ||
| 107 | + trigger(trigger) { | ||
| 108 | + this.formTrigger = trigger | ||
| 109 | + }, | ||
| 110 | + }, | ||
| 111 | + created() { | ||
| 112 | + let _this = this | ||
| 113 | + this.childrens = [] | ||
| 114 | + this.inputChildrens = [] | ||
| 115 | + this.checkboxChildrens = [] | ||
| 116 | + this.formRules = [] | ||
| 117 | + // this.init(this.rules) | ||
| 118 | + }, | ||
| 119 | + mounted() { | ||
| 120 | + this.init(this.rules) | ||
| 121 | + }, | ||
| 122 | + methods: { | ||
| 123 | + init(formRules) { | ||
| 124 | + // 判断是否有规则 | ||
| 125 | + if (Object.keys(formRules).length > 0) { | ||
| 126 | + this.formTrigger = this.trigger | ||
| 127 | + this.formRules = formRules | ||
| 128 | + if (!this.validator) { | ||
| 129 | + this.validator = new Validator(formRules) | ||
| 130 | + } | ||
| 131 | + } else { | ||
| 132 | + return | ||
| 133 | + } | ||
| 134 | + // 判断表单存在那些实例 | ||
| 135 | + for (let i in this.value) { | ||
| 136 | + const itemData = this.childrens.find(v => v.name === i) | ||
| 137 | + if (itemData) { | ||
| 138 | + this.formData[i] = this.value[i] | ||
| 139 | + itemData.init() | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + // watch 每个属性 ,需要知道具体那个属性发变化 | ||
| 144 | + Object.keys(this.value).forEach((key) => { | ||
| 145 | + this.$watch('value.' + key, (newVal) => { | ||
| 146 | + const itemData = this.childrens.find(v => v.name === key) | ||
| 147 | + if (itemData) { | ||
| 148 | + this.formData[key] = this._getValue(key, newVal) | ||
| 149 | + itemData.init() | ||
| 150 | + } else { | ||
| 151 | + this.formData[key] = this.value[key] || null | ||
| 152 | + } | ||
| 153 | + }) | ||
| 154 | + }) | ||
| 155 | + }, | ||
| 156 | + /** | ||
| 157 | + * 设置校验规则 | ||
| 158 | + * @param {Object} formRules | ||
| 159 | + */ | ||
| 160 | + setRules(formRules) { | ||
| 161 | + this.init(formRules) | ||
| 162 | + }, | ||
| 163 | + /** | ||
| 164 | + * 公开给用户使用 | ||
| 165 | + * 设置自定义表单组件 value 值 | ||
| 166 | + * @param {String} name 字段名称 | ||
| 167 | + * @param {String} value 字段值 | ||
| 168 | + */ | ||
| 169 | + setValue(name, value, callback) { | ||
| 170 | + let example = this.childrens.find(child => child.name === name) | ||
| 171 | + if (!example) return null | ||
| 172 | + value = this._getValue(example.name, value) | ||
| 173 | + this.formData[name] = value | ||
| 174 | + example.val = value | ||
| 175 | + this.$emit('input', Object.assign({}, this.value, this.formData)) | ||
| 176 | + return example.triggerCheck(value, callback) | ||
| 177 | + }, | ||
| 178 | + | ||
| 179 | + /** | ||
| 180 | + * TODO 表单提交, 小程序暂不支持这种用法 | ||
| 181 | + * @param {Object} event | ||
| 182 | + */ | ||
| 183 | + submitForm(event) { | ||
| 184 | + const value = event.detail.value | ||
| 185 | + return this.validateAll(value || this.formData, 'submit') | ||
| 186 | + }, | ||
| 187 | + | ||
| 188 | + /** | ||
| 189 | + * 表单重置 | ||
| 190 | + * @param {Object} event | ||
| 191 | + */ | ||
| 192 | + resetForm(event) { | ||
| 193 | + this.childrens.forEach(item => { | ||
| 194 | + item.errMsg = '' | ||
| 195 | + const inputComp = this.inputChildrens.find(child => child.rename === item.name) | ||
| 196 | + if (inputComp) { | ||
| 197 | + inputComp.errMsg = '' | ||
| 198 | + inputComp.$emit('input', inputComp.multiple ? [] : '') | ||
| 199 | + } | ||
| 200 | + }) | ||
| 201 | + | ||
| 202 | + this.childrens.forEach((item) => { | ||
| 203 | + if (item.name) { | ||
| 204 | + this.formData[item.name] = this._getValue(item.name, '') | ||
| 205 | + } | ||
| 206 | + }) | ||
| 207 | + | ||
| 208 | + this.$emit('input', this.formData) | ||
| 209 | + this.$emit('reset', event) | ||
| 210 | + }, | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * 触发表单校验,通过 @validate 获取 | ||
| 214 | + * @param {Object} validate | ||
| 215 | + */ | ||
| 216 | + validateCheck(validate) { | ||
| 217 | + if (validate === null) validate = null | ||
| 218 | + this.$emit('validate', validate) | ||
| 219 | + }, | ||
| 220 | + /** | ||
| 221 | + * 校验所有或者部分表单 | ||
| 222 | + */ | ||
| 223 | + async validateAll(invalidFields, type, callback) { | ||
| 224 | + this.childrens.forEach(item => { | ||
| 225 | + item.errMsg = '' | ||
| 226 | + }) | ||
| 227 | + | ||
| 228 | + let promise; | ||
| 229 | + if (!callback && typeof callback !== 'function' && Promise) { | ||
| 230 | + promise = new Promise((resolve, reject) => { | ||
| 231 | + callback = function(valid, invalidFields) { | ||
| 232 | + !valid ? resolve(invalidFields) : reject(valid); | ||
| 233 | + }; | ||
| 234 | + }); | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + let fieldsValue = {} | ||
| 238 | + let tempInvalidFields = Object.assign({}, invalidFields) | ||
| 239 | + | ||
| 240 | + Object.keys(this.formRules).forEach(item => { | ||
| 241 | + const values = this.formRules[item] | ||
| 242 | + const rules = (values && values.rules) || [] | ||
| 243 | + let isNoField = false | ||
| 244 | + for (let i = 0; i < rules.length; i++) { | ||
| 245 | + const rule = rules[i] | ||
| 246 | + if (rule.required) { | ||
| 247 | + isNoField = true | ||
| 248 | + break | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + // 如果存在 required 才会将内容插入校验对象 | ||
| 252 | + if (!isNoField && (!tempInvalidFields[item] && tempInvalidFields[item] !== false)) { | ||
| 253 | + delete tempInvalidFields[item] | ||
| 254 | + } | ||
| 255 | + }) | ||
| 256 | + | ||
| 257 | + // 循环字段是否存在于校验规则中 | ||
| 258 | + for (let i in this.formRules) { | ||
| 259 | + for (let j in tempInvalidFields) { | ||
| 260 | + if (i === j) { | ||
| 261 | + fieldsValue[i] = tempInvalidFields[i] | ||
| 262 | + } | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + let result = [] | ||
| 266 | + let example = null | ||
| 267 | + | ||
| 268 | + let newFormData = {} | ||
| 269 | + this.childrens.forEach(v => { | ||
| 270 | + newFormData[v.name] = this._getValue(v.name,invalidFields[v.name]) | ||
| 271 | + }) | ||
| 272 | + if (this.validator) { | ||
| 273 | + for (let i in fieldsValue) { | ||
| 274 | + // 循环校验,目的是异步校验 | ||
| 275 | + const resultData = await this.validator.validateUpdate({ | ||
| 276 | + [i]: fieldsValue[i] | ||
| 277 | + }, this.formData) | ||
| 278 | + | ||
| 279 | + // 未通过 | ||
| 280 | + if (resultData) { | ||
| 281 | + // 获取当前未通过子组件实例 | ||
| 282 | + example = this.childrens.find(child => child.name === resultData.key) | ||
| 283 | + // 获取easyInput 组件实例 | ||
| 284 | + const inputComp = this.inputChildrens.find(child => child.rename === (example && example.name)) | ||
| 285 | + if (inputComp) { | ||
| 286 | + inputComp.errMsg = resultData.errorMessage | ||
| 287 | + } | ||
| 288 | + result.push(resultData) | ||
| 289 | + // 区分触发类型 | ||
| 290 | + if (this.errShowType === 'undertext') { | ||
| 291 | + if (example) example.errMsg = resultData.errorMessage | ||
| 292 | + } else { | ||
| 293 | + if (this.errShowType === 'toast') { | ||
| 294 | + uni.showToast({ | ||
| 295 | + title: resultData.errorMessage || '校验错误', | ||
| 296 | + icon: 'none' | ||
| 297 | + }) | ||
| 298 | + break | ||
| 299 | + } else if (this.errShowType === 'modal') { | ||
| 300 | + uni.showModal({ | ||
| 301 | + title: '提示', | ||
| 302 | + content: resultData.errorMessage || '校验错误' | ||
| 303 | + }) | ||
| 304 | + break | ||
| 305 | + } else { | ||
| 306 | + if (example) example.errMsg = resultData.errorMessage | ||
| 307 | + } | ||
| 308 | + } | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + if (Array.isArray(result)) { | ||
| 314 | + if (result.length === 0) result = null | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + if (type === 'submit') { | ||
| 318 | + this.$emit('submit', { | ||
| 319 | + detail: { | ||
| 320 | + value: newFormData, | ||
| 321 | + errors: result | ||
| 322 | + } | ||
| 323 | + }) | ||
| 324 | + } else { | ||
| 325 | + this.$emit('validate', result) | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + callback && typeof callback === 'function' && callback(result, newFormData) | ||
| 329 | + | ||
| 330 | + if (promise && callback) { | ||
| 331 | + return promise | ||
| 332 | + } else { | ||
| 333 | + return null | ||
| 334 | + } | ||
| 335 | + }, | ||
| 336 | + | ||
| 337 | + /** | ||
| 338 | + * 外部调用方法 | ||
| 339 | + * 手动提交校验表单 | ||
| 340 | + * 对整个表单进行校验的方法,参数为一个回调函数。 | ||
| 341 | + */ | ||
| 342 | + submit(callback) { | ||
| 343 | + // Object.assign(this.formData,formData) | ||
| 344 | + return this.validateAll(this.formData, 'submit', callback) | ||
| 345 | + }, | ||
| 346 | + | ||
| 347 | + /** | ||
| 348 | + * 外部调用方法 | ||
| 349 | + * 校验表单 | ||
| 350 | + * 对整个表单进行校验的方法,参数为一个回调函数。 | ||
| 351 | + */ | ||
| 352 | + validate(callback) { | ||
| 353 | + return this.validateAll(this.formData, '', callback) | ||
| 354 | + }, | ||
| 355 | + | ||
| 356 | + /** | ||
| 357 | + * 部分表单校验 | ||
| 358 | + * @param {Object} props | ||
| 359 | + * @param {Object} cb | ||
| 360 | + */ | ||
| 361 | + validateField(props, callback) { | ||
| 362 | + props = [].concat(props); | ||
| 363 | + let invalidFields = {} | ||
| 364 | + this.childrens.forEach(item => { | ||
| 365 | + if (props.indexOf(item.name) !== -1) { | ||
| 366 | + invalidFields = Object.assign({}, invalidFields, { | ||
| 367 | + [item.name]: this.formData[item.name] | ||
| 368 | + }) | ||
| 369 | + } | ||
| 370 | + }) | ||
| 371 | + return this.validateAll(invalidFields, '', callback) | ||
| 372 | + }, | ||
| 373 | + | ||
| 374 | + /** | ||
| 375 | + * 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果 | ||
| 376 | + */ | ||
| 377 | + resetFields() { | ||
| 378 | + this.resetForm() | ||
| 379 | + }, | ||
| 380 | + | ||
| 381 | + /** | ||
| 382 | + * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果 | ||
| 383 | + */ | ||
| 384 | + clearValidate(props) { | ||
| 385 | + props = [].concat(props); | ||
| 386 | + this.childrens.forEach(item => { | ||
| 387 | + const inputComp = this.inputChildrens.find(child => child.rename === item.name) | ||
| 388 | + if (props.length === 0) { | ||
| 389 | + item.errMsg = '' | ||
| 390 | + if (inputComp) { | ||
| 391 | + inputComp.errMsg = '' | ||
| 392 | + } | ||
| 393 | + } else { | ||
| 394 | + if (props.indexOf(item.name) !== -1) { | ||
| 395 | + item.errMsg = '' | ||
| 396 | + if (inputComp) { | ||
| 397 | + inputComp.errMsg = '' | ||
| 398 | + } | ||
| 399 | + } | ||
| 400 | + } | ||
| 401 | + }) | ||
| 402 | + }, | ||
| 403 | + /** | ||
| 404 | + * 把 value 转换成指定的类型 | ||
| 405 | + * @param {Object} key | ||
| 406 | + * @param {Object} value | ||
| 407 | + */ | ||
| 408 | + _getValue(key, value) { | ||
| 409 | + const rules = (this.formRules[key] && this.formRules[key].rules) || [] | ||
| 410 | + const isRuleNum = rules.find(val => val.format && this.type_filter(val.format)) | ||
| 411 | + const isRuleBool = rules.find(val => val.format && val.format === 'boolean' || val.format === 'bool') | ||
| 412 | + // 输入值为 number | ||
| 413 | + if (isRuleNum) { | ||
| 414 | + value = isNaN(value) ? value : (value === '' || value === null ? null : Number(value)) | ||
| 415 | + } | ||
| 416 | + // 简单判断真假值 | ||
| 417 | + if (isRuleBool) { | ||
| 418 | + value = !value ? false : true | ||
| 419 | + } | ||
| 420 | + return value | ||
| 421 | + }, | ||
| 422 | + /** | ||
| 423 | + * 过滤数字类型 | ||
| 424 | + * @param {Object} format | ||
| 425 | + */ | ||
| 426 | + type_filter(format) { | ||
| 427 | + return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp' | ||
| 428 | + } | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | +</script> | ||
| 432 | + | ||
| 433 | +<style lang="scss" scoped> | ||
| 434 | + .uni-forms { | ||
| 435 | + // overflow: hidden; | ||
| 436 | + // padding: 10px 15px; | ||
| 437 | + // background-color: #fff; | ||
| 438 | + } | ||
| 439 | + | ||
| 440 | + .uni-forms--top { | ||
| 441 | + padding: 10px 15px; | ||
| 442 | + // padding-top: 22px; | ||
| 443 | + } | ||
| 444 | +</style> |
components/uni-forms/validate.js
0 → 100644
| 1 | + | ||
| 2 | +var pattern = { | ||
| 3 | + email: /^\S+?@\S+?\.\S+?$/, | ||
| 4 | + url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i') | ||
| 5 | +}; | ||
| 6 | + | ||
| 7 | +const FORMAT_MAPPING = { | ||
| 8 | + "int": 'number', | ||
| 9 | + "bool": 'boolean', | ||
| 10 | + "double": 'number', | ||
| 11 | + "long": 'number', | ||
| 12 | + "password": 'string' | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +function formatMessage(args, resources) { | ||
| 16 | + var defaultMessage = ['label'] | ||
| 17 | + defaultMessage.forEach((item) => { | ||
| 18 | + if (args[item] === undefined) { | ||
| 19 | + args[item] = '' | ||
| 20 | + } | ||
| 21 | + }) | ||
| 22 | + | ||
| 23 | + let str = resources | ||
| 24 | + for (let key in args) { | ||
| 25 | + let reg = new RegExp('{' + key + '}') | ||
| 26 | + str = str.replace(reg, args[key]) | ||
| 27 | + } | ||
| 28 | + return str | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +function isEmptyValue(value, type) { | ||
| 32 | + if (value === undefined || value === null) { | ||
| 33 | + return true; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + if (typeof value === 'string' && !value) { | ||
| 37 | + return true; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + if (Array.isArray(value) && !value.length) { | ||
| 41 | + return true; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + if (type === 'object' && !Object.keys(value).length) { | ||
| 45 | + return true; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + return false; | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +const types = { | ||
| 52 | + integer(value) { | ||
| 53 | + return types.number(value) && parseInt(value, 10) === value; | ||
| 54 | + }, | ||
| 55 | + string(value) { | ||
| 56 | + return typeof value === 'string'; | ||
| 57 | + }, | ||
| 58 | + number(value) { | ||
| 59 | + if (isNaN(value)) { | ||
| 60 | + return false; | ||
| 61 | + } | ||
| 62 | + return typeof value === 'number'; | ||
| 63 | + }, | ||
| 64 | + "boolean": function (value) { | ||
| 65 | + return typeof value === 'boolean'; | ||
| 66 | + }, | ||
| 67 | + "float": function (value) { | ||
| 68 | + return types.number(value) && !types.integer(value); | ||
| 69 | + }, | ||
| 70 | + array(value) { | ||
| 71 | + return Array.isArray(value); | ||
| 72 | + }, | ||
| 73 | + object(value) { | ||
| 74 | + return typeof value === 'object' && !types.array(value); | ||
| 75 | + }, | ||
| 76 | + date(value) { | ||
| 77 | + var v | ||
| 78 | + if (value instanceof Date) { | ||
| 79 | + v = value; | ||
| 80 | + } else { | ||
| 81 | + v = new Date(value); | ||
| 82 | + } | ||
| 83 | + return typeof v.getTime === 'function' && typeof v.getMonth === 'function' && typeof v.getYear === 'function' && !isNaN(v.getTime()); | ||
| 84 | + }, | ||
| 85 | + timestamp(value) { | ||
| 86 | + if (!this.integer(value) || Math.abs(value).toString().length > 16) { | ||
| 87 | + return false | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + return this.date(value); | ||
| 91 | + }, | ||
| 92 | + email(value) { | ||
| 93 | + return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255; | ||
| 94 | + }, | ||
| 95 | + url(value) { | ||
| 96 | + return typeof value === 'string' && !!value.match(pattern.url); | ||
| 97 | + }, | ||
| 98 | + pattern(reg, value) { | ||
| 99 | + try { | ||
| 100 | + return new RegExp(reg).test(value); | ||
| 101 | + } catch (e) { | ||
| 102 | + return false; | ||
| 103 | + } | ||
| 104 | + }, | ||
| 105 | + method(value) { | ||
| 106 | + return typeof value === 'function'; | ||
| 107 | + } | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +class RuleValidator { | ||
| 111 | + | ||
| 112 | + constructor(message) { | ||
| 113 | + this._message = message | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + async validateRule(key, value, data, allData) { | ||
| 117 | + var result = null | ||
| 118 | + | ||
| 119 | + let rules = key.rules | ||
| 120 | + | ||
| 121 | + let hasRequired = rules.findIndex((item) => { | ||
| 122 | + return item.required | ||
| 123 | + }) | ||
| 124 | + if (hasRequired < 0) { | ||
| 125 | + if (value === null || value === undefined) { | ||
| 126 | + return result | ||
| 127 | + } | ||
| 128 | + if (typeof value === 'string' && !value.length) { | ||
| 129 | + return result | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + var message = this._message | ||
| 134 | + | ||
| 135 | + if (rules === undefined) { | ||
| 136 | + return message['default'] | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + for (var i = 0; i < rules.length; i++) { | ||
| 140 | + let rule = rules[i] | ||
| 141 | + let vt = this._getValidateType(rule) | ||
| 142 | + | ||
| 143 | + if (key.label !== undefined) { | ||
| 144 | + Object.assign(rule, { | ||
| 145 | + label: key.label | ||
| 146 | + }) | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + if (RuleValidatorHelper[vt]) { | ||
| 150 | + result = RuleValidatorHelper[vt](rule, value, message) | ||
| 151 | + if (result != null) { | ||
| 152 | + break | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + if (rule.validateExpr) { | ||
| 157 | + let now = Date.now() | ||
| 158 | + let resultExpr = rule.validateExpr(value, allData, now) | ||
| 159 | + if (resultExpr === false) { | ||
| 160 | + result = this._getMessage(rule, rule.errorMessage || this._message['default']) | ||
| 161 | + break | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + if (rule.validateFunction) { | ||
| 166 | + result = await this.validateFunction(rule, value, data, allData, vt) | ||
| 167 | + if (result !== null) { | ||
| 168 | + break | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + return result | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + async validateFunction(rule, value, data, allData, vt) { | ||
| 177 | + let result = null | ||
| 178 | + try { | ||
| 179 | + let callbackMessage = null | ||
| 180 | + const res = await rule.validateFunction(rule, value, allData || data, (message) => { | ||
| 181 | + callbackMessage = message | ||
| 182 | + }) | ||
| 183 | + if (callbackMessage || (typeof res === 'string' && res) || res === false) { | ||
| 184 | + result = this._getMessage(rule, callbackMessage || res, vt) | ||
| 185 | + } | ||
| 186 | + } catch (e) { | ||
| 187 | + result = this._getMessage(rule, e.message, vt) | ||
| 188 | + } | ||
| 189 | + return result | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + _getMessage(rule, message, vt) { | ||
| 193 | + return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']) | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + _getValidateType(rule) { | ||
| 197 | + // TODO | ||
| 198 | + var result = '' | ||
| 199 | + if (rule.required) { | ||
| 200 | + result = 'required' | ||
| 201 | + } else if (rule.format) { | ||
| 202 | + result = 'format' | ||
| 203 | + } else if (rule.range) { | ||
| 204 | + result = 'range' | ||
| 205 | + } else if (rule.maximum || rule.minimum) { | ||
| 206 | + result = 'rangeNumber' | ||
| 207 | + } else if (rule.maxLength || rule.minLength) { | ||
| 208 | + result = 'rangeLength' | ||
| 209 | + } else if (rule.pattern) { | ||
| 210 | + result = 'pattern' | ||
| 211 | + } | ||
| 212 | + return result | ||
| 213 | + } | ||
| 214 | +} | ||
| 215 | + | ||
| 216 | +const RuleValidatorHelper = { | ||
| 217 | + required(rule, value, message) { | ||
| 218 | + if (rule.required && isEmptyValue(value, rule.format || typeof value)) { | ||
| 219 | + return formatMessage(rule, rule.errorMessage || message.required); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + return null | ||
| 223 | + }, | ||
| 224 | + | ||
| 225 | + range(rule, value, message) { | ||
| 226 | + const { range, errorMessage } = rule; | ||
| 227 | + | ||
| 228 | + let list = new Array(range.length); | ||
| 229 | + for (let i = 0; i < range.length; i++) { | ||
| 230 | + const item = range[i]; | ||
| 231 | + if (types.object(item) && item.value !== undefined) { | ||
| 232 | + list[i] = item.value; | ||
| 233 | + } else { | ||
| 234 | + list[i] = item; | ||
| 235 | + } | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + let result = false | ||
| 239 | + if (Array.isArray(value)) { | ||
| 240 | + result = (new Set(value.concat(list)).size === list.length); | ||
| 241 | + } else { | ||
| 242 | + if (list.indexOf(value) > -1) { | ||
| 243 | + result = true; | ||
| 244 | + } | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + if (!result) { | ||
| 248 | + return formatMessage(rule, errorMessage || message['enum']); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + return null | ||
| 252 | + }, | ||
| 253 | + | ||
| 254 | + rangeNumber(rule, value, message) { | ||
| 255 | + if (!types.number(value)) { | ||
| 256 | + return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | + let { minimum, maximum, exclusiveMinimum, exclusiveMaximum } = rule; | ||
| 260 | + let min = exclusiveMinimum ? value <= minimum : value < minimum; | ||
| 261 | + let max = exclusiveMaximum ? value >= maximum : value > maximum; | ||
| 262 | + | ||
| 263 | + if (minimum !== undefined && min) { | ||
| 264 | + return formatMessage(rule, rule.errorMessage || message['number'].min) | ||
| 265 | + } else if (maximum !== undefined && max) { | ||
| 266 | + return formatMessage(rule, rule.errorMessage || message['number'].max) | ||
| 267 | + } else if (minimum !== undefined && maximum !== undefined && (min || max)) { | ||
| 268 | + return formatMessage(rule, rule.errorMessage || message['number'].range) | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + return null | ||
| 272 | + }, | ||
| 273 | + | ||
| 274 | + rangeLength(rule, value, message) { | ||
| 275 | + if (!types.string(value) && !types.array(value)) { | ||
| 276 | + return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + let min = rule.minLength; | ||
| 280 | + let max = rule.maxLength; | ||
| 281 | + let val = value.length; | ||
| 282 | + | ||
| 283 | + if (min !== undefined && val < min) { | ||
| 284 | + return formatMessage(rule, rule.errorMessage || message['length'].min) | ||
| 285 | + } else if (max !== undefined && val > max) { | ||
| 286 | + return formatMessage(rule, rule.errorMessage || message['length'].max) | ||
| 287 | + } else if (min !== undefined && max !== undefined && (val < min || val > max)) { | ||
| 288 | + return formatMessage(rule, rule.errorMessage || message['length'].range) | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + return null | ||
| 292 | + }, | ||
| 293 | + | ||
| 294 | + pattern(rule, value, message) { | ||
| 295 | + if (!types['pattern'](rule.pattern, value)) { | ||
| 296 | + return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + return null | ||
| 300 | + }, | ||
| 301 | + | ||
| 302 | + format(rule, value, message) { | ||
| 303 | + var customTypes = Object.keys(types); | ||
| 304 | + var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format; | ||
| 305 | + | ||
| 306 | + if (customTypes.indexOf(format) > -1) { | ||
| 307 | + if (!types[format](value)) { | ||
| 308 | + return formatMessage(rule, rule.errorMessage || message.types[format]); | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + return null | ||
| 313 | + } | ||
| 314 | +} | ||
| 315 | + | ||
| 316 | +class SchemaValidator extends RuleValidator { | ||
| 317 | + | ||
| 318 | + constructor(schema, options) { | ||
| 319 | + super(SchemaValidator.message); | ||
| 320 | + | ||
| 321 | + this._schema = schema | ||
| 322 | + this._options = options || null | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + updateSchema(schema) { | ||
| 326 | + this._schema = schema | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + async validate(data, allData) { | ||
| 330 | + let result = this._checkFieldInSchema(data) | ||
| 331 | + if (!result) { | ||
| 332 | + result = await this.invokeValidate(data, false, allData) | ||
| 333 | + } | ||
| 334 | + return result.length ? result[0] : null | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + async validateAll(data, allData) { | ||
| 338 | + let result = this._checkFieldInSchema(data) | ||
| 339 | + if (!result) { | ||
| 340 | + result = await this.invokeValidate(data, true, allData) | ||
| 341 | + } | ||
| 342 | + return result | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + async validateUpdate(data, allData) { | ||
| 346 | + let result = this._checkFieldInSchema(data) | ||
| 347 | + if (!result) { | ||
| 348 | + result = await this.invokeValidateUpdate(data, false, allData) | ||
| 349 | + } | ||
| 350 | + return result.length ? result[0] : null | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + async invokeValidate(data, all, allData) { | ||
| 354 | + let result = [] | ||
| 355 | + let schema = this._schema | ||
| 356 | + for (let key in schema) { | ||
| 357 | + let value = schema[key] | ||
| 358 | + let errorMessage = await this.validateRule(value, data[key], data, allData) | ||
| 359 | + if (errorMessage != null) { | ||
| 360 | + result.push({ | ||
| 361 | + key, | ||
| 362 | + errorMessage | ||
| 363 | + }) | ||
| 364 | + if (!all) break | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + return result | ||
| 368 | + } | ||
| 369 | + | ||
| 370 | + async invokeValidateUpdate(data, all, allData) { | ||
| 371 | + let result = [] | ||
| 372 | + for (let key in data) { | ||
| 373 | + let errorMessage = await this.validateRule(this._schema[key], data[key], data, allData) | ||
| 374 | + if (errorMessage != null) { | ||
| 375 | + result.push({ | ||
| 376 | + key, | ||
| 377 | + errorMessage | ||
| 378 | + }) | ||
| 379 | + if (!all) break | ||
| 380 | + } | ||
| 381 | + } | ||
| 382 | + return result | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + _checkFieldInSchema(data) { | ||
| 386 | + var keys = Object.keys(data) | ||
| 387 | + var keys2 = Object.keys(this._schema) | ||
| 388 | + if (new Set(keys.concat(keys2)).size === keys2.length) { | ||
| 389 | + return '' | ||
| 390 | + } | ||
| 391 | + return [{ | ||
| 392 | + key: 'invalid', | ||
| 393 | + errorMessage: SchemaValidator.message['defaultInvalid'] | ||
| 394 | + }] | ||
| 395 | + } | ||
| 396 | +} | ||
| 397 | + | ||
| 398 | +function Message() { | ||
| 399 | + return { | ||
| 400 | + default: '验证错误', | ||
| 401 | + defaultInvalid: '字段超出范围', | ||
| 402 | + required: '{label}必填', | ||
| 403 | + 'enum': '{label}超出范围', | ||
| 404 | + whitespace: '{label}不能为空', | ||
| 405 | + date: { | ||
| 406 | + format: '{label}日期{value}格式无效', | ||
| 407 | + parse: '{label}日期无法解析,{value}无效', | ||
| 408 | + invalid: '{label}日期{value}无效' | ||
| 409 | + }, | ||
| 410 | + types: { | ||
| 411 | + string: '{label}类型无效', | ||
| 412 | + array: '{label}类型无效', | ||
| 413 | + object: '{label}类型无效', | ||
| 414 | + number: '{label}类型无效', | ||
| 415 | + date: '{label}类型无效', | ||
| 416 | + boolean: '{label}类型无效', | ||
| 417 | + integer: '{label}类型无效', | ||
| 418 | + float: '{label}类型无效', | ||
| 419 | + regexp: '{label}无效', | ||
| 420 | + email: '{label}类型无效', | ||
| 421 | + url: '{label}类型无效' | ||
| 422 | + }, | ||
| 423 | + length: { | ||
| 424 | + min: '{label}长度不能少于{minLength}', | ||
| 425 | + max: '{label}长度不能超过{maxLength}', | ||
| 426 | + range: '{label}必须介于{minLength}和{maxLength}之间' | ||
| 427 | + }, | ||
| 428 | + number: { | ||
| 429 | + min: '{label}不能小于{minimum}', | ||
| 430 | + max: '{label}不能大于{maximum}', | ||
| 431 | + range: '{label}必须介于{minimum}and{maximum}之间' | ||
| 432 | + }, | ||
| 433 | + pattern: { | ||
| 434 | + mismatch: '{label}格式不匹配' | ||
| 435 | + } | ||
| 436 | + }; | ||
| 437 | +} | ||
| 438 | + | ||
| 439 | + | ||
| 440 | +SchemaValidator.message = new Message(); | ||
| 441 | + | ||
| 442 | +export default SchemaValidator |
components/usp-tinymce/dynamicLoadScript.js
0 → 100644
| 1 | +let callbacks = [] | ||
| 2 | + | ||
| 3 | +function loadedTinymce() { | ||
| 4 | + // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144 | ||
| 5 | + // check is successfully downloaded script | ||
| 6 | + return window.tinymce | ||
| 7 | +} | ||
| 8 | + | ||
| 9 | +const dynamicLoadScript = (src, callback) => { | ||
| 10 | + const existingScript = document.getElementById(src) | ||
| 11 | + const cb = callback || function() {} | ||
| 12 | + | ||
| 13 | + if (!existingScript) { | ||
| 14 | + const script = document.createElement('script') | ||
| 15 | + script.src = src // src url for the third-party library being loaded. | ||
| 16 | + script.id = src | ||
| 17 | + document.body.appendChild(script) | ||
| 18 | + callbacks.push(cb) | ||
| 19 | + const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd | ||
| 20 | + onEnd(script) | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + if (existingScript && cb) { | ||
| 24 | + if (loadedTinymce()) { | ||
| 25 | + cb(null, existingScript) | ||
| 26 | + } else { | ||
| 27 | + callbacks.push(cb) | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + function stdOnEnd(script) { | ||
| 32 | + script.onload = function() { | ||
| 33 | + // this.onload = null here is necessary | ||
| 34 | + // because even IE9 works not like others | ||
| 35 | + this.onerror = this.onload = null | ||
| 36 | + for (const cb of callbacks) { | ||
| 37 | + cb(null, script) | ||
| 38 | + } | ||
| 39 | + callbacks = null | ||
| 40 | + } | ||
| 41 | + script.onerror = function() { | ||
| 42 | + this.onerror = this.onload = null | ||
| 43 | + cb(new Error('Failed to load ' + src), script) | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + function ieOnEnd(script) { | ||
| 48 | + script.onreadystatechange = function() { | ||
| 49 | + if (this.readyState !== 'complete' && this.readyState !== 'loaded') return | ||
| 50 | + this.onreadystatechange = null | ||
| 51 | + for (const cb of callbacks) { | ||
| 52 | + cb(null, script) // there is no way to catch loading errors in IE8 | ||
| 53 | + } | ||
| 54 | + callbacks = null | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +export default dynamicLoadScript |
components/usp-tinymce/plugins.js
0 → 100644
| 1 | +// Any plugins you want to use has to be imported | ||
| 2 | +// Detail plugins list see https://www.tinymce.com/docs/plugins/ | ||
| 3 | +// Custom builds see https://www.tinymce.com/download/custom-builds/ | ||
| 4 | + | ||
| 5 | +const plugins = [ | ||
| 6 | + ` | ||
| 7 | + advlist | ||
| 8 | + autolink | ||
| 9 | + autosave | ||
| 10 | + code | ||
| 11 | + codesample | ||
| 12 | + colorpicker | ||
| 13 | + colorpicker | ||
| 14 | + contextmenu | ||
| 15 | + directionality | ||
| 16 | + emoticons | ||
| 17 | + fullscreen | ||
| 18 | + hr | ||
| 19 | + image | ||
| 20 | + imagetools | ||
| 21 | + insertdatetime | ||
| 22 | + lists | ||
| 23 | + media | ||
| 24 | + nonbreaking | ||
| 25 | + noneditable | ||
| 26 | + paste | ||
| 27 | + preview | ||
| 28 | |||
| 29 | + save | ||
| 30 | + searchreplace | ||
| 31 | + tabfocus | ||
| 32 | + table | ||
| 33 | + textcolor | ||
| 34 | + textpattern | ||
| 35 | + visualblocks | ||
| 36 | + visualchars | ||
| 37 | + wordcount | ||
| 38 | + ` | ||
| 39 | +] | ||
| 40 | + | ||
| 41 | +export default plugins |
components/usp-tinymce/toolbar.js
0 → 100644
| 1 | +// Here is a list of the toolbar | ||
| 2 | +// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols | ||
| 3 | + | ||
| 4 | +const toolbar = [ | ||
| 5 | + 'bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript', | ||
| 6 | + 'hr bullist numlist image table forecolor backcolor code preview fullscreen' | ||
| 7 | +] | ||
| 8 | + | ||
| 9 | +export default toolbar |
components/usp-tinymce/usp-tinymce.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div :class="{fullscreen:fullscreen, loaded: loaded}" class="tinymce-container" :style="{width:containerWidth}"> | ||
| 3 | + <textarea :id="tinymceId" class="tinymce-textarea" /> | ||
| 4 | + </div> | ||
| 5 | +</template> | ||
| 6 | + | ||
| 7 | +<script> | ||
| 8 | +import plugins from './plugins' | ||
| 9 | +import toolbar from './toolbar' | ||
| 10 | +import load from './dynamicLoadScript' | ||
| 11 | + | ||
| 12 | +const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js' | ||
| 13 | + | ||
| 14 | +export default { | ||
| 15 | + name: 'uspTinymce', | ||
| 16 | + props: { | ||
| 17 | + id: { | ||
| 18 | + type: String, | ||
| 19 | + default() { | ||
| 20 | + return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') | ||
| 21 | + } | ||
| 22 | + }, | ||
| 23 | + value: { | ||
| 24 | + type: String, | ||
| 25 | + default: '' | ||
| 26 | + }, | ||
| 27 | + toolbar: { | ||
| 28 | + type: Array, | ||
| 29 | + required: false, | ||
| 30 | + default() { | ||
| 31 | + return [] | ||
| 32 | + } | ||
| 33 | + }, | ||
| 34 | + menubar: { | ||
| 35 | + type: String, | ||
| 36 | + default: 'file edit insert view format table' | ||
| 37 | + }, | ||
| 38 | + height: { | ||
| 39 | + type: [Number, String], | ||
| 40 | + required: false, | ||
| 41 | + default: 360 | ||
| 42 | + }, | ||
| 43 | + width: { | ||
| 44 | + type: [Number, String], | ||
| 45 | + required: false, | ||
| 46 | + default: 'auto' | ||
| 47 | + }, | ||
| 48 | + isHtml:{ | ||
| 49 | + type: Boolean, | ||
| 50 | + default: true | ||
| 51 | + } | ||
| 52 | + }, | ||
| 53 | + data() { | ||
| 54 | + return { | ||
| 55 | + loaded: false, | ||
| 56 | + hasChange: false, | ||
| 57 | + hasInit: false, | ||
| 58 | + tinymceId: this.id, | ||
| 59 | + fullscreen: false, | ||
| 60 | + languageTypeList: { | ||
| 61 | + 'en': 'en', | ||
| 62 | + 'zh': 'zh_CN', | ||
| 63 | + 'es': 'es_MX', | ||
| 64 | + 'ja': 'ja' | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + }, | ||
| 68 | + computed: { | ||
| 69 | + containerWidth() { | ||
| 70 | + const width = this.width | ||
| 71 | + if (/^[\d]+(\.[\d]+)?$/.test(width)) { // matches `100`, `'100'` | ||
| 72 | + return `${width}px` | ||
| 73 | + } | ||
| 74 | + return width | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + watch: { | ||
| 78 | + value(val) { | ||
| 79 | + if (!this.hasChange && this.hasInit) { | ||
| 80 | + this.$nextTick(() =>window.tinymce.get(this.tinymceId).setContent(val || '')) | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + }, | ||
| 84 | + mounted() { | ||
| 85 | + this.init() | ||
| 86 | + }, | ||
| 87 | + activated() { | ||
| 88 | + if (window.tinymce) { | ||
| 89 | + this.initTinymce() | ||
| 90 | + } | ||
| 91 | + }, | ||
| 92 | + deactivated() { | ||
| 93 | + this.destroyTinymce() | ||
| 94 | + }, | ||
| 95 | + destroyed() { | ||
| 96 | + this.destroyTinymce() | ||
| 97 | + }, | ||
| 98 | + methods: { | ||
| 99 | + init() { | ||
| 100 | + // dynamic load tinymce from cdn | ||
| 101 | + load(tinymceCDN, (err) => { | ||
| 102 | + if (err) { | ||
| 103 | + this.$message.error(err.message) | ||
| 104 | + return | ||
| 105 | + } | ||
| 106 | + this.initTinymce() | ||
| 107 | + }) | ||
| 108 | + }, | ||
| 109 | + initTinymce() { | ||
| 110 | + const _this = this | ||
| 111 | + window.tinymce.init({ | ||
| 112 | + selector: `#${this.tinymceId}`, | ||
| 113 | + images_upload_handler: async (blobInfo, succFun, failFun, progress)=> { | ||
| 114 | + progress(0); | ||
| 115 | + let fileName = + new Date() + ('000000' + Math.floor(Math.random() * 999999)).slice(-6); | ||
| 116 | + fileName += blobInfo.blob().type === 'image/jpeg' ? '.jpg' : '.png'; | ||
| 117 | + const result = await uniCloud.uploadFile({ | ||
| 118 | + filePath: blobInfo.blobUri(), | ||
| 119 | + cloudPath: fileName, | ||
| 120 | + onUploadProgress: progressEvent=> { | ||
| 121 | + progress(Math.round( | ||
| 122 | + (progressEvent.loaded * 100) / progressEvent.total | ||
| 123 | + )); | ||
| 124 | + } | ||
| 125 | + }); | ||
| 126 | + | ||
| 127 | + const tempFiles = await uniCloud.getTempFileURL({ | ||
| 128 | + fileList: [result.fileID] | ||
| 129 | + }) | ||
| 130 | + const tempFile = tempFiles.fileList[0]; | ||
| 131 | + if(tempFile.code === 'SUCCESS'){ | ||
| 132 | + succFun(tempFile.download_url); | ||
| 133 | + }else{ | ||
| 134 | + failFun('上传失败'); | ||
| 135 | + } | ||
| 136 | + }, | ||
| 137 | + language: this.languageTypeList['zh'], | ||
| 138 | + height: this.height, | ||
| 139 | + body_class: 'panel-body ', | ||
| 140 | + object_resizing: false, | ||
| 141 | + toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar, | ||
| 142 | + menubar: this.menubar, | ||
| 143 | + plugins: plugins, | ||
| 144 | + end_container_on_empty_block: true, | ||
| 145 | + powerpaste_word_import: 'clean', | ||
| 146 | + code_dialog_height: 450, | ||
| 147 | + code_dialog_width: 1000, | ||
| 148 | + advlist_bullet_styles: 'square', | ||
| 149 | + advlist_number_styles: 'default', | ||
| 150 | + imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'], | ||
| 151 | + default_link_target: '_blank', | ||
| 152 | + link_title: false, | ||
| 153 | + nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin | ||
| 154 | + init_instance_callback: editor => { | ||
| 155 | + //if (_this.value) { | ||
| 156 | + editor.setContent(_this.value || '') | ||
| 157 | + setTimeout(()=>{ | ||
| 158 | + this.loaded = true; | ||
| 159 | + }, 100) | ||
| 160 | + //} | ||
| 161 | + _this.hasInit = true | ||
| 162 | + editor.on('NodeChange Change KeyUp SetContent', () => { | ||
| 163 | + this.hasChange = true | ||
| 164 | + if(this.isHtml){ | ||
| 165 | + this.$emit('input', editor.getContent()) | ||
| 166 | + }else{ | ||
| 167 | + this.$emit('input', editor.getContent({format: 'text'})) | ||
| 168 | + } | ||
| 169 | + }) | ||
| 170 | + }, | ||
| 171 | + setup(editor) { | ||
| 172 | + editor.on('FullscreenStateChanged', (e) => { | ||
| 173 | + _this.fullscreen = e.state | ||
| 174 | + }) | ||
| 175 | + } | ||
| 176 | + }) | ||
| 177 | + }, | ||
| 178 | + destroyTinymce() { | ||
| 179 | + const tinymce = window.tinymce.get(this.tinymceId) | ||
| 180 | + if (this.fullscreen) { | ||
| 181 | + tinymce.execCommand('mceFullScreen') | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + if (tinymce) { | ||
| 185 | + tinymce.destroy() | ||
| 186 | + } | ||
| 187 | + }, | ||
| 188 | + setContent(value) { | ||
| 189 | + window.tinymce.get(this.tinymceId).setContent(value) | ||
| 190 | + }, | ||
| 191 | + getContent() { | ||
| 192 | + window.tinymce.get(this.tinymceId).getContent() | ||
| 193 | + }, | ||
| 194 | + imageSuccessCBK(arr) { | ||
| 195 | + const _this = this | ||
| 196 | + arr.forEach(v => { | ||
| 197 | + window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`) | ||
| 198 | + }) | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | +} | ||
| 202 | +</script> | ||
| 203 | + | ||
| 204 | +<style scoped lang="scss"> | ||
| 205 | + /deep/ { | ||
| 206 | + .tinymce-container { | ||
| 207 | + position: relative; | ||
| 208 | + line-height: normal; | ||
| 209 | + } | ||
| 210 | + .tinymce-container>>>.mce-fullscreen { | ||
| 211 | + z-index: 10000; | ||
| 212 | + } | ||
| 213 | + .tinymce-textarea { | ||
| 214 | + visibility: hidden; | ||
| 215 | + z-index: -1; | ||
| 216 | + } | ||
| 217 | + .editor-custom-btn-container { | ||
| 218 | + position: absolute; | ||
| 219 | + right: 4px; | ||
| 220 | + top: 4px; | ||
| 221 | + /*z-index: 2005;*/ | ||
| 222 | + } | ||
| 223 | + .fullscreen .editor-custom-btn-container { | ||
| 224 | + z-index: 10000; | ||
| 225 | + position: fixed; | ||
| 226 | + } | ||
| 227 | + .editor-upload-btn { | ||
| 228 | + display: inline-block; | ||
| 229 | + } | ||
| 230 | + .mce-tinymce{ | ||
| 231 | + box-shadow: 0 1px 2px rgba(0, 0, 0, 0) !important; | ||
| 232 | + border-color: #DCDFE6 !important; | ||
| 233 | + } | ||
| 234 | + .mce-top-part::before{ | ||
| 235 | + box-shadow: 0 1px 2px rgba(0, 0, 0, 0) !important; | ||
| 236 | + } | ||
| 237 | + .mce-edit-area{ | ||
| 238 | + border-color: #DCDFE6 !important; | ||
| 239 | + | ||
| 240 | + iframe{ | ||
| 241 | + opacity: 0; | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | + .mce-statusbar{ | ||
| 245 | + border-color: #DCDFE6 !important; | ||
| 246 | + } | ||
| 247 | + #mceu_27{ | ||
| 248 | + border-radius: 5px; | ||
| 249 | + overflow: hidden; | ||
| 250 | + } | ||
| 251 | + /* 菜单图标字体颜色 */ | ||
| 252 | + .mce-ico{ | ||
| 253 | + color: #7e8086 !important; | ||
| 254 | + } | ||
| 255 | + /* 选中项图标为白色 */ | ||
| 256 | + .mce-btn.mce-active i{ | ||
| 257 | + color: #fff !important; | ||
| 258 | + } | ||
| 259 | + /* 背景颜色图标 */ | ||
| 260 | + i.mce-i-backcolor{ | ||
| 261 | + color: #fff !important; | ||
| 262 | + background-color: #ff944c !important; | ||
| 263 | + } | ||
| 264 | + /* 字体颜色图标 */ | ||
| 265 | + i.mce-i-forecolor{ | ||
| 266 | + color: #ff944c !important; | ||
| 267 | + transform: scale(1.1); | ||
| 268 | + } | ||
| 269 | + } | ||
| 270 | + .loaded /deep/ iframe{ | ||
| 271 | + opacity: 1; | ||
| 272 | + } | ||
| 273 | +</style> | ||
| 0 | \ No newline at end of file | 274 | \ No newline at end of file |
pages.json
| 1 | -{ | ||
| 2 | - "easycom": { | ||
| 3 | - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" | ||
| 4 | - }, | ||
| 5 | - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages | ||
| 6 | - { | ||
| 7 | - "path": "pages/home/home", | ||
| 8 | - "style": { | ||
| 9 | - "navigationStyle": "custom" | ||
| 10 | - } | ||
| 11 | - },{ | ||
| 12 | - "path": "pages/login/login", | ||
| 13 | - "style": { | ||
| 14 | - "navigationStyle": "custom" | ||
| 15 | - } | ||
| 16 | - },{ | ||
| 17 | - "path": "pages/workbench/workbench", | ||
| 18 | - "style": { | ||
| 19 | - "navigationStyle": "custom" | ||
| 20 | - } | ||
| 21 | - }, { | ||
| 22 | - "path": "pages/my/my", | ||
| 23 | - "style": { | ||
| 24 | - "navigationStyle": "custom" | ||
| 25 | - } | ||
| 26 | - },{ | ||
| 27 | - "path": "pages/apply/apply", | ||
| 28 | - "style": { | ||
| 29 | - "navigationBarTitleText": "申请记录", | ||
| 30 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 31 | - } | ||
| 32 | - },{ | ||
| 33 | - "path": "pages/shops/shops", | ||
| 34 | - "style": { | ||
| 35 | - "navigationBarTitleText": "租商铺", | ||
| 36 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 37 | - } | ||
| 38 | - },{ | ||
| 39 | - "path": "pages/applyDetail/applyDetail", | ||
| 40 | - "style": { | ||
| 41 | - "navigationBarTitleText": "详情", | ||
| 42 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 43 | - } | ||
| 44 | - },{ | ||
| 45 | - "path": "pages/message/message", | ||
| 46 | - "style": { | ||
| 47 | - "navigationStyle": "custom" | ||
| 48 | - } | ||
| 49 | - },{ | ||
| 50 | - "path": "pages/field/field", | ||
| 51 | - "style": { | ||
| 52 | - "navigationBarTitleText": "租场地", | ||
| 53 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 54 | - } | ||
| 55 | - },{ | ||
| 56 | - "path": "pages/advertisementDetail/advertisementDetail", | ||
| 57 | - "style": { | ||
| 58 | - "navigationBarTitleText": "详情", | ||
| 59 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 60 | - } | ||
| 61 | - },{ | ||
| 62 | - "path": "pages/advertisement/advertisement", | ||
| 63 | - "style": { | ||
| 64 | - "navigationBarTitleText": "租广告", | ||
| 65 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 66 | - } | ||
| 67 | - },{ | ||
| 68 | - "path": "pages/details/details", | ||
| 69 | - "style": { | ||
| 70 | - "navigationBarTitleText": "详情", | ||
| 71 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 72 | - } | ||
| 73 | - },{ | ||
| 74 | - "path": "pages/leaseAdd/leaseAdd", | ||
| 75 | - "style": { | ||
| 76 | - "navigationBarTitleText": "申请租赁", | ||
| 77 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 78 | - } | ||
| 79 | - },{ | ||
| 80 | - "path": "pages/recordService/recordService", | ||
| 81 | - "style": { | ||
| 82 | - "navigationBarTitleText": "服务记录", | ||
| 83 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 84 | - } | ||
| 85 | - },{ | ||
| 86 | - "path": "pages/activityAdd/activityAdd", | ||
| 87 | - "style": { | ||
| 88 | - "navigationBarTitleText": "活动申请", | ||
| 89 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 90 | - } | ||
| 91 | - },{ | ||
| 92 | - "path": "pages/complaint/complaint", | ||
| 93 | - "style": { | ||
| 94 | - "navigationBarTitleText": "投诉建议", | ||
| 95 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 96 | - } | ||
| 97 | - },{ | ||
| 98 | - "path": "pages/repair/repair", | ||
| 99 | - "style": { | ||
| 100 | - "navigationBarTitleText": "故障报修", | ||
| 101 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 102 | - } | ||
| 103 | - },{ | ||
| 104 | - "path": "pages/advertisementTime/advertisementTime", | ||
| 105 | - "style": { | ||
| 106 | - "navigationBarTitleText": "租赁时段选择", | ||
| 107 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 108 | - } | ||
| 109 | - },{ | ||
| 110 | - "path": "pages/advertisementAdd/advertisementAdd", | ||
| 111 | - "style": { | ||
| 112 | - "navigationBarTitleText": "广告申请", | ||
| 113 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 114 | - } | ||
| 115 | - }, | ||
| 116 | - { | ||
| 117 | - "path": "pages/participation/participation", | ||
| 118 | - "style": { | ||
| 119 | - "navigationBarTitleText": "活动参与", | ||
| 120 | - "navigationBarBackgroundColor": "#fff", | ||
| 121 | - "enablePullDownRefresh": true | ||
| 122 | - } | ||
| 123 | - }, | ||
| 124 | - { | ||
| 125 | - "path": "pages/questionnaire/questionnaire", | ||
| 126 | - "style": { | ||
| 127 | - "navigationBarTitleText": "问卷调查", | ||
| 128 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 129 | - } | ||
| 130 | - }, | ||
| 131 | - { | ||
| 132 | - "path": "pages/createQuestionnaire/createQuestionnaire", | ||
| 133 | - "style": { | ||
| 134 | - "navigationBarTitleText": "创建问卷", | ||
| 135 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 136 | - } | ||
| 137 | - }, | ||
| 138 | - { | ||
| 139 | - "path": "pages/mycreated/mycreated", | ||
| 140 | - "style": { | ||
| 141 | - "navigationBarTitleText": "我的活动申请", | ||
| 142 | - "navigationBarBackgroundColor": "#FFFFFF", | ||
| 143 | - "enablePullDownRefresh": true | ||
| 144 | - } | ||
| 145 | - }, | ||
| 146 | - { | ||
| 147 | - "path": "pages/record/record", | ||
| 148 | - "style": { | ||
| 149 | - "navigationBarTitleText": "申请记录", | ||
| 150 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 151 | - } | ||
| 152 | - }, | ||
| 153 | - { | ||
| 154 | - "path": "pages/accepting/accepting", | ||
| 155 | - "style": { | ||
| 156 | - "navigationBarTitleText": "详情", | ||
| 157 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 158 | - } | ||
| 159 | - }, | ||
| 160 | - { | ||
| 161 | - "path": "pages/servicerecords/servicerecords", | ||
| 162 | - "style": { | ||
| 163 | - "navigationBarTitleText": "服务记录", | ||
| 164 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 165 | - } | ||
| 166 | - }, | ||
| 167 | - { | ||
| 168 | - "path": "pages/servicedetails/servicedetails", | ||
| 169 | - "style": { | ||
| 170 | - "navigationBarTitleText": "详情", | ||
| 171 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 172 | - } | ||
| 173 | - }, | ||
| 174 | - { | ||
| 175 | - "path": "pages/application/application", | ||
| 176 | - "style": { | ||
| 177 | - "navigationBarTitleText": "推广方案申请", | ||
| 178 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 179 | - } | ||
| 180 | - }, | ||
| 181 | - { | ||
| 182 | - "path": "pages/projectManagement/projectManagement", | ||
| 183 | - "style": { | ||
| 184 | - "navigationBarTitleText": "推广方案管理", | ||
| 185 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 186 | - } | ||
| 187 | - }, | ||
| 188 | - { | ||
| 189 | - "path": "pages/shopjcMsg/shopjcMsg", | ||
| 190 | - "style": { | ||
| 191 | - "navigationBarTitleText": "商家基本信息", | ||
| 192 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 193 | - } | ||
| 194 | - }, | ||
| 195 | - { | ||
| 196 | - "path": "pages/procedure/procedure", | ||
| 197 | - "style": { | ||
| 198 | - "navigationBarTitleText": "公告通知", | ||
| 199 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 200 | - } | ||
| 201 | - }, | ||
| 202 | - { | ||
| 203 | - "path": "pages/salesReporting/salesReporting", | ||
| 204 | - "style": { | ||
| 205 | - "navigationBarTitleText": "销售上报", | ||
| 206 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 207 | - } | ||
| 208 | - }, | ||
| 209 | - { | ||
| 210 | - "path": "pages/orderList/orderList", | ||
| 211 | - "style": { | ||
| 212 | - "navigationBarTitleText": "订单查询", | ||
| 213 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 214 | - } | ||
| 215 | - }, | ||
| 216 | - { | ||
| 217 | - "path": "pages/salesSta/salesSta", | ||
| 218 | - "style": { | ||
| 219 | - "navigationBarTitleText": "销售统计", | ||
| 220 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 221 | - } | ||
| 222 | - }, | ||
| 223 | - { | ||
| 224 | - "path": "pages/Iproposal/Iproposal", | ||
| 225 | - "style": { | ||
| 226 | - "navigationBarTitleText": "招商方案", | ||
| 227 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 228 | - } | ||
| 229 | - }, | ||
| 230 | - // 营销推广活动 | ||
| 231 | - { | ||
| 232 | - "path": "pages/marketing/marketingList/marketingList", | ||
| 233 | - "style": { | ||
| 234 | - "navigationBarTitleText": "营销推广活动", | ||
| 235 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 236 | - } | ||
| 237 | - }, | ||
| 238 | - { | ||
| 239 | - "path": "pages/marketing/marketingDetail/marketingDetail", | ||
| 240 | - "style": { | ||
| 241 | - "navigationBarTitleText": "详情", | ||
| 242 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 243 | - } | ||
| 244 | - }, | ||
| 245 | - // 商务合作 | ||
| 246 | - { | ||
| 247 | - "path": "pages/business/businessList/businessList", | ||
| 248 | - "style": { | ||
| 249 | - "navigationBarTitleText": "商务合作", | ||
| 250 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 251 | - } | ||
| 252 | - }, | ||
| 253 | - { | ||
| 254 | - "path": "pages/business/businessDetail/businessDetail", | ||
| 255 | - "style": { | ||
| 256 | - "navigationBarTitleText": "详情", | ||
| 257 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 258 | - } | ||
| 259 | - }, | ||
| 260 | - { | ||
| 261 | - "path": "pages/privacy/privacy", | ||
| 262 | - "style": { | ||
| 263 | - "navigationBarTitleText": "绿道用户隐私政策", | ||
| 264 | - "navigationBarBackgroundColor": "#FFFFFF" | ||
| 265 | - } | ||
| 266 | - } | ||
| 267 | - ], | ||
| 268 | - "globalStyle": { | ||
| 269 | - "navigationBarTextStyle": "black" | ||
| 270 | - }, | ||
| 271 | - "tabBar": { | ||
| 272 | - "custom": true, | ||
| 273 | - "selectedColor": "#F15A29", | ||
| 274 | - "backgroundColor": "#fff", | ||
| 275 | - "list": [{ | ||
| 276 | - "iconPath": "/static/tabbar/tab_01.png", | ||
| 277 | - "selectedIconPath": "/static/tabbar/tab_02.png", | ||
| 278 | - "pagePath": "pages/home/home", | ||
| 279 | - "text": "" | ||
| 280 | - }, | ||
| 281 | - { | ||
| 282 | - "selectedIconPath": "/static/tabbar/tab_03.png", | ||
| 283 | - "iconPath": "/static/tabbar/tab_04.png", | ||
| 284 | - "pagePath": "pages/workbench/workbench", | ||
| 285 | - "text": "" | ||
| 286 | - }, | ||
| 287 | - { | ||
| 288 | - "iconPath": "/static/tabbar/tab_05.png", | ||
| 289 | - "selectedIconPath": "/static/tabbar/tab_06.png", | ||
| 290 | - "pagePath": "pages/message/message", | ||
| 291 | - "text": "" | ||
| 292 | - }, | ||
| 293 | - { | ||
| 294 | - "iconPath": "/static/tabbar/tab_07.png", | ||
| 295 | - "selectedIconPath": "/static/tabbar/tab_08.png", | ||
| 296 | - "pagePath": "pages/my/my", | ||
| 297 | - "text": "" | ||
| 298 | - } | ||
| 299 | - ] | ||
| 300 | - } | ||
| 301 | -} | 1 | +{ |
| 2 | + "easycom": { | ||
| 3 | + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" | ||
| 4 | + }, | ||
| 5 | + "pages": [ | ||
| 6 | + { | ||
| 7 | + "path": "pages/home/home", | ||
| 8 | + "style": { | ||
| 9 | + "navigationStyle": "custom" | ||
| 10 | + } | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "path": "pages/login/login", | ||
| 14 | + "style": { | ||
| 15 | + "navigationStyle": "custom" | ||
| 16 | + } | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + "path": "pages/workbench/workbench", | ||
| 20 | + "style": { | ||
| 21 | + "navigationStyle": "custom" | ||
| 22 | + } | ||
| 23 | + }, | ||
| 24 | + { | ||
| 25 | + "path": "pages/my/my", | ||
| 26 | + "style": { | ||
| 27 | + "navigationStyle": "custom" | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + { | ||
| 31 | + "path": "pages/apply/apply", | ||
| 32 | + "style": { | ||
| 33 | + "navigationBarTitleText": "申请记录", | ||
| 34 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + "path": "pages/shops/shops", | ||
| 39 | + "style": { | ||
| 40 | + "navigationBarTitleText": "租商铺", | ||
| 41 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + { | ||
| 45 | + "path": "pages/applyDetail/applyDetail", | ||
| 46 | + "style": { | ||
| 47 | + "navigationBarTitleText": "详情", | ||
| 48 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 49 | + } | ||
| 50 | + }, | ||
| 51 | + { | ||
| 52 | + "path": "pages/message/message", | ||
| 53 | + "style": { | ||
| 54 | + "navigationStyle": "custom" | ||
| 55 | + } | ||
| 56 | + }, | ||
| 57 | + { | ||
| 58 | + "path": "pages/field/field", | ||
| 59 | + "style": { | ||
| 60 | + "navigationBarTitleText": "租场地", | ||
| 61 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 62 | + } | ||
| 63 | + }, | ||
| 64 | + { | ||
| 65 | + "path": "pages/advertisementDetail/advertisementDetail", | ||
| 66 | + "style": { | ||
| 67 | + "navigationBarTitleText": "详情", | ||
| 68 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 69 | + } | ||
| 70 | + }, | ||
| 71 | + { | ||
| 72 | + "path": "pages/advertisement/advertisement", | ||
| 73 | + "style": { | ||
| 74 | + "navigationBarTitleText": "租广告", | ||
| 75 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 76 | + } | ||
| 77 | + }, | ||
| 78 | + { | ||
| 79 | + "path": "pages/details/details", | ||
| 80 | + "style": { | ||
| 81 | + "navigationBarTitleText": "详情", | ||
| 82 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 83 | + } | ||
| 84 | + }, | ||
| 85 | + { | ||
| 86 | + "path": "pages/leaseAdd/leaseAdd", | ||
| 87 | + "style": { | ||
| 88 | + "navigationBarTitleText": "申请租赁", | ||
| 89 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 90 | + } | ||
| 91 | + }, | ||
| 92 | + { | ||
| 93 | + "path": "pages/intentionApply/intentionApply", | ||
| 94 | + "style": { | ||
| 95 | + "navigationBarTitleText": "意向申请", | ||
| 96 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 97 | + } | ||
| 98 | + }, | ||
| 99 | + { | ||
| 100 | + "path": "pages/recordService/recordService", | ||
| 101 | + "style": { | ||
| 102 | + "navigationBarTitleText": "服务记录", | ||
| 103 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 104 | + } | ||
| 105 | + }, | ||
| 106 | + { | ||
| 107 | + "path": "pages/activityAdd/activityAdd", | ||
| 108 | + "style": { | ||
| 109 | + "navigationBarTitleText": "活动申请", | ||
| 110 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 111 | + } | ||
| 112 | + }, | ||
| 113 | + { | ||
| 114 | + "path": "pages/complaint/complaint", | ||
| 115 | + "style": { | ||
| 116 | + "navigationBarTitleText": "投诉建议", | ||
| 117 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 118 | + } | ||
| 119 | + }, | ||
| 120 | + { | ||
| 121 | + "path": "pages/repair/repair", | ||
| 122 | + "style": { | ||
| 123 | + "navigationBarTitleText": "故障报修", | ||
| 124 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 125 | + } | ||
| 126 | + }, | ||
| 127 | + { | ||
| 128 | + "path": "pages/advertisementTime/advertisementTime", | ||
| 129 | + "style": { | ||
| 130 | + "enablePullDownRefresh": false, | ||
| 131 | + "navigationBarTitleText": "投放时段", | ||
| 132 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 133 | + } | ||
| 134 | + }, | ||
| 135 | + { | ||
| 136 | + "path": "pages/advertisementAdd/advertisementAdd", | ||
| 137 | + "style": { | ||
| 138 | + "navigationBarTitleText": "广告申请", | ||
| 139 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 140 | + } | ||
| 141 | + }, | ||
| 142 | + { | ||
| 143 | + "path": "pages/participation/participation", | ||
| 144 | + "style": { | ||
| 145 | + "navigationBarTitleText": "活动参与", | ||
| 146 | + "navigationBarBackgroundColor": "#fff", | ||
| 147 | + "enablePullDownRefresh": true | ||
| 148 | + } | ||
| 149 | + }, | ||
| 150 | + { | ||
| 151 | + "path": "pages/questionnaire/questionnaire", | ||
| 152 | + "style": { | ||
| 153 | + "navigationBarTitleText": "问卷调查", | ||
| 154 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 155 | + } | ||
| 156 | + }, | ||
| 157 | + { | ||
| 158 | + "path": "pages/createQuestionnaire/createQuestionnaire", | ||
| 159 | + "style": { | ||
| 160 | + "navigationBarTitleText": "创建问卷", | ||
| 161 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 162 | + } | ||
| 163 | + }, | ||
| 164 | + { | ||
| 165 | + "path": "pages/mycreated/mycreated", | ||
| 166 | + "style": { | ||
| 167 | + "navigationBarTitleText": "我的活动申请", | ||
| 168 | + "navigationBarBackgroundColor": "#FFFFFF", | ||
| 169 | + "enablePullDownRefresh": true | ||
| 170 | + } | ||
| 171 | + }, | ||
| 172 | + { | ||
| 173 | + "path": "pages/record/record", | ||
| 174 | + "style": { | ||
| 175 | + "navigationBarTitleText": "申请记录", | ||
| 176 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 177 | + } | ||
| 178 | + }, | ||
| 179 | + { | ||
| 180 | + "path": "pages/accepting/accepting", | ||
| 181 | + "style": { | ||
| 182 | + "navigationBarTitleText": "详情", | ||
| 183 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + { | ||
| 187 | + "path": "pages/servicerecords/servicerecords", | ||
| 188 | + "style": { | ||
| 189 | + "navigationBarTitleText": "服务记录", | ||
| 190 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + { | ||
| 194 | + "path": "pages/servicedetails/servicedetails", | ||
| 195 | + "style": { | ||
| 196 | + "navigationBarTitleText": "详情", | ||
| 197 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + { | ||
| 201 | + "path": "pages/application/application", | ||
| 202 | + "style": { | ||
| 203 | + "navigationBarTitleText": "推广方案申请", | ||
| 204 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 205 | + } | ||
| 206 | + }, | ||
| 207 | + { | ||
| 208 | + "path": "pages/projectManagement/projectManagement", | ||
| 209 | + "style": { | ||
| 210 | + "navigationBarTitleText": "推广方案管理", | ||
| 211 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 212 | + } | ||
| 213 | + }, | ||
| 214 | + { | ||
| 215 | + "path": "pages/shopjcMsg/shopjcMsg", | ||
| 216 | + "style": { | ||
| 217 | + "navigationBarTitleText": "商家基本信息", | ||
| 218 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 219 | + } | ||
| 220 | + }, | ||
| 221 | + { | ||
| 222 | + "path": "pages/procedure/procedure", | ||
| 223 | + "style": { | ||
| 224 | + "navigationBarTitleText": "公告通知", | ||
| 225 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 226 | + } | ||
| 227 | + }, | ||
| 228 | + { | ||
| 229 | + "path": "pages/salesReporting/salesReporting", | ||
| 230 | + "style": { | ||
| 231 | + "navigationBarTitleText": "销售上报", | ||
| 232 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 233 | + } | ||
| 234 | + }, | ||
| 235 | + { | ||
| 236 | + "path": "pages/orderList/orderList", | ||
| 237 | + "style": { | ||
| 238 | + "navigationBarTitleText": "订单查询", | ||
| 239 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 240 | + } | ||
| 241 | + }, | ||
| 242 | + { | ||
| 243 | + "path": "pages/salesSta/salesSta", | ||
| 244 | + "style": { | ||
| 245 | + "navigationBarTitleText": "销售统计", | ||
| 246 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 247 | + } | ||
| 248 | + }, | ||
| 249 | + { | ||
| 250 | + "path": "pages/Iproposal/Iproposal", | ||
| 251 | + "style": { | ||
| 252 | + "navigationBarTitleText": "招商方案", | ||
| 253 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 254 | + } | ||
| 255 | + }, | ||
| 256 | + { | ||
| 257 | + "path": "pages/marketing/marketingList/marketingList", | ||
| 258 | + "style": { | ||
| 259 | + "navigationBarTitleText": "营销推广活动", | ||
| 260 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 261 | + } | ||
| 262 | + }, | ||
| 263 | + { | ||
| 264 | + "path": "pages/marketing/marketingDetail/marketingDetail", | ||
| 265 | + "style": { | ||
| 266 | + "navigationBarTitleText": "详情", | ||
| 267 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 268 | + } | ||
| 269 | + }, | ||
| 270 | + { | ||
| 271 | + "path": "pages/business/businessList/businessList", | ||
| 272 | + "style": { | ||
| 273 | + "navigationBarTitleText": "商务合作", | ||
| 274 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 275 | + } | ||
| 276 | + }, | ||
| 277 | + { | ||
| 278 | + "path": "pages/business/businessDetail/businessDetail", | ||
| 279 | + "style": { | ||
| 280 | + "navigationBarTitleText": "详情", | ||
| 281 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 282 | + } | ||
| 283 | + }, | ||
| 284 | + { | ||
| 285 | + "path": "pages/propertyPay/propertyPayList/propertyPayList", | ||
| 286 | + "style": { | ||
| 287 | + "navigationBarTitleText": "物业缴费", | ||
| 288 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 289 | + } | ||
| 290 | + }, | ||
| 291 | + { | ||
| 292 | + "path": "pages/propertyPay/payRecord/payRecord", | ||
| 293 | + "style": { | ||
| 294 | + "navigationBarTitleText": "缴费记录", | ||
| 295 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 296 | + } | ||
| 297 | + }, | ||
| 298 | + { | ||
| 299 | + "path": "pages/propertyPay/payDetail/payDetail", | ||
| 300 | + "style": { | ||
| 301 | + "navigationBarTitleText": "缴费记录", | ||
| 302 | + "navigationBarBackgroundColor": "#FFFFFF" | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + ], | ||
| 307 | + "globalStyle": { | ||
| 308 | + "navigationBarTextStyle": "black" | ||
| 309 | + }, | ||
| 310 | + "tabBar": { | ||
| 311 | + "custom": true, | ||
| 312 | + "selectedColor": "#F15A29", | ||
| 313 | + "backgroundColor": "#fff", | ||
| 314 | + "list": [ | ||
| 315 | + { | ||
| 316 | + "iconPath": "/static/tabbar/tab_01.png", | ||
| 317 | + "selectedIconPath": "/static/tabbar/tab_02.png", | ||
| 318 | + "pagePath": "pages/home/home", | ||
| 319 | + "text": "" | ||
| 320 | + }, | ||
| 321 | + { | ||
| 322 | + "selectedIconPath": "/static/tabbar/tab_03.png", | ||
| 323 | + "iconPath": "/static/tabbar/tab_04.png", | ||
| 324 | + "pagePath": "pages/workbench/workbench", | ||
| 325 | + "text": "" | ||
| 326 | + }, | ||
| 327 | + { | ||
| 328 | + "iconPath": "/static/tabbar/tab_05.png", | ||
| 329 | + "selectedIconPath": "/static/tabbar/tab_06.png", | ||
| 330 | + "pagePath": "pages/message/message", | ||
| 331 | + "text": "" | ||
| 332 | + }, | ||
| 333 | + { | ||
| 334 | + "iconPath": "/static/tabbar/tab_07.png", | ||
| 335 | + "selectedIconPath": "/static/tabbar/tab_08.png", | ||
| 336 | + "pagePath": "pages/my/my", | ||
| 337 | + "text": "" | ||
| 338 | + } | ||
| 339 | + ] | ||
| 340 | + } | ||
| 341 | +} | ||
| 302 | \ No newline at end of file | 342 | \ No newline at end of file |
pages/accepting/accepting.scss
| @@ -4,117 +4,147 @@ | @@ -4,117 +4,147 @@ | ||
| 4 | top: 0; | 4 | top: 0; |
| 5 | width: 100%; | 5 | width: 100%; |
| 6 | height: 100%; | 6 | height: 100%; |
| 7 | + padding: 0 24rpx; | ||
| 7 | } | 8 | } |
| 8 | /* 记录列表 */ | 9 | /* 记录列表 */ |
| 9 | .record-list{ | 10 | .record-list{ |
| 10 | margin-top: 20rpx; | 11 | margin-top: 20rpx; |
| 11 | - .record-list-box { | ||
| 12 | - padding: 30rpx; | ||
| 13 | - background-color: #FFFFFF; | ||
| 14 | - margin-bottom: 20rpx; | ||
| 15 | - } | ||
| 16 | - .list-btn { | ||
| 17 | - display: inline-block; | 12 | + .good-item { |
| 18 | width: 100%; | 13 | width: 100%; |
| 19 | - text-align: right; | ||
| 20 | - padding-bottom: 10rpx; | ||
| 21 | - .date-btn { | ||
| 22 | - background-color: #3f9b6a; | ||
| 23 | - color: #fff; | ||
| 24 | - font-size: 28rpx; | ||
| 25 | - font-weight: bold; | ||
| 26 | - padding: 10rpx 20rpx; | ||
| 27 | - border-radius: 10rpx; | ||
| 28 | - } | ||
| 29 | - } | ||
| 30 | - .list{ | ||
| 31 | display: flex; | 14 | display: flex; |
| 32 | - align-items: center; | ||
| 33 | - justify-content: space-between; | ||
| 34 | - .thumb{ | ||
| 35 | - display: flex; | ||
| 36 | - width: 36%; | ||
| 37 | - image{ | ||
| 38 | - width: 230rpx; | ||
| 39 | - height: 200rpx; | ||
| 40 | - border-radius: 10rpx; | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - .title-date{ | ||
| 44 | - .date{ | ||
| 45 | - margin: 14rpx 0; | ||
| 46 | - text{ | ||
| 47 | - color:#3D3D3D; | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - } | 15 | + background-color: #fff; |
| 16 | + padding: 16rpx; | ||
| 17 | + border-radius: 14rpx; | ||
| 18 | + margin-bottom: 26rpx; | ||
| 19 | + .img { | ||
| 20 | + width: 200rpx; | ||
| 21 | + height: 200rpx; | ||
| 51 | } | 22 | } |
| 52 | - .integral{ | ||
| 53 | - text{ | 23 | + .info { |
| 24 | + width: calc(100% - 220rpx); | ||
| 25 | + margin-left: 20rpx; | ||
| 26 | + .title { | ||
| 27 | + width: 100%; | ||
| 54 | font-size: 28rpx; | 28 | font-size: 28rpx; |
| 55 | - color: #3D3D3D; | 29 | + line-height: 44rpx; |
| 30 | + font-weight: 700; | ||
| 31 | + white-space: nowrap; | ||
| 32 | + overflow : hidden; | ||
| 33 | + text-overflow: ellipsis; | ||
| 34 | + margin-bottom: 20rpx; | ||
| 56 | } | 35 | } |
| 57 | - image { | ||
| 58 | - width: 22rpx; | ||
| 59 | - height: 22rpx; | 36 | + .info-item { |
| 37 | + display: flex; | ||
| 38 | + line-height: 30rpx; | ||
| 39 | + font-size: 26rpx; | ||
| 40 | + color: #717981; | ||
| 41 | + text { | ||
| 42 | + white-space: nowrap; | ||
| 43 | + overflow : hidden; | ||
| 44 | + text-overflow: ellipsis; | ||
| 45 | + margin-left: 10rpx; | ||
| 46 | + span { | ||
| 47 | + font-size: 30rpx; | ||
| 48 | + color: #000; | ||
| 49 | + font-weight: 700; | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + .u-tag { | ||
| 53 | + margin: 0 6rpx; | ||
| 54 | + border: unset; | ||
| 55 | + } | ||
| 60 | } | 56 | } |
| 61 | } | 57 | } |
| 62 | } | 58 | } |
| 63 | } | 59 | } |
| 64 | .msglist{ | 60 | .msglist{ |
| 65 | - padding:40rpx 30rpx; | 61 | + padding: 0 30rpx; |
| 66 | background-color: #Fff; | 62 | background-color: #Fff; |
| 67 | - position: relative; | ||
| 68 | - .msg_title{ | ||
| 69 | - display: flex; | ||
| 70 | - width: 100%; | ||
| 71 | - margin-bottom: 30rpx; | ||
| 72 | - } | ||
| 73 | - view{ | ||
| 74 | - width: 30%; | ||
| 75 | - } | ||
| 76 | - .msg_body{ | ||
| 77 | - margin-left: 30rpx; | ||
| 78 | - width: 70%; | ||
| 79 | - } | ||
| 80 | - .imgGroup{ | 63 | + border-radius: 14rpx; |
| 64 | + margin-bottom: 20rpx; | ||
| 65 | + .form-item { | ||
| 81 | display: flex; | 66 | display: flex; |
| 82 | - image{ | ||
| 83 | - width: 200rpx; | ||
| 84 | - height: 160rpx; | ||
| 85 | - margin-right: 30rpx; | ||
| 86 | - } | ||
| 87 | - } | ||
| 88 | - .state{ | ||
| 89 | - position: absolute; | ||
| 90 | - right: -100rpx; | ||
| 91 | - top: 28rpx; | ||
| 92 | - font-weight: 600; | ||
| 93 | - font-size: 32rpx; | ||
| 94 | - } | ||
| 95 | - .org{ | ||
| 96 | - color:#CDA33A; | 67 | + flex-direction: row; |
| 68 | + align-items: center; | ||
| 69 | + justify-content: space-between; | ||
| 70 | + line-height: 70rpx; | ||
| 71 | + border-bottom: #eee solid 1rpx; | ||
| 72 | + padding: 10rpx 0; | ||
| 73 | + &[label-top] { | ||
| 74 | + flex-direction: column; | ||
| 75 | + justify-content: flex-start; | ||
| 76 | + align-items: flex-start; | ||
| 77 | + } | ||
| 78 | + text { | ||
| 79 | + font-size: 24rpx; | ||
| 80 | + color: #3D3D3D; | ||
| 81 | + } | ||
| 82 | + .img { | ||
| 83 | + padding-bottom: 18rpx; | ||
| 84 | + } | ||
| 85 | + .deom-box { | ||
| 86 | + width: 100%; | ||
| 87 | + display: flex !important; | ||
| 88 | + margin: 0 -20rpx; | ||
| 89 | + background-color: #FFFFFF; | ||
| 90 | + border-radius: 9px; | ||
| 91 | + // margin-top: 9px; | ||
| 92 | + width: 100%; | ||
| 93 | + // .u-upload { | ||
| 94 | + // .u-add-wrap { | ||
| 95 | + // width: 304rpx !important; | ||
| 96 | + // height: 182rpx !important; | ||
| 97 | + // } | ||
| 98 | + // } | ||
| 99 | + // .u-upload { | ||
| 100 | + // height: 88px; | ||
| 101 | + // width: 155px; | ||
| 102 | + // background: url(/static/images/uploadID1.png); | ||
| 103 | + // background-size:134rpx 188rpx; | ||
| 104 | + // background-repeat:no-repeat; | ||
| 105 | + // } | ||
| 106 | + .img-deom { | ||
| 107 | + flex: 1; | ||
| 108 | + display: flex; | ||
| 109 | + flex-direction: column; | ||
| 110 | + align-items: center; | ||
| 111 | + padding: 20rpx; | ||
| 112 | + text { | ||
| 113 | + margin-top: 18rpx; | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + } | ||
| 97 | } | 117 | } |
| 98 | - .green{ | ||
| 99 | - color:#219129; | 118 | + :last-child { |
| 119 | + border-bottom: unset; | ||
| 100 | } | 120 | } |
| 101 | } | 121 | } |
| 102 | .footbtn{ | 122 | .footbtn{ |
| 103 | - position: absolute; | 123 | + position: fixed; |
| 104 | bottom: 0; | 124 | bottom: 0; |
| 105 | left: 0; | 125 | left: 0; |
| 106 | z-index: 10; | 126 | z-index: 10; |
| 127 | + height:180rpx; | ||
| 107 | width: 100%; | 128 | width: 100%; |
| 108 | - .zhifu{ | 129 | + border-radius: 26rpx 26rpx 0 0; |
| 130 | + background-color: #fff; | ||
| 131 | + .info-total { | ||
| 109 | display: flex; | 132 | display: flex; |
| 133 | + flex-direction: row; | ||
| 134 | + align-items: center; | ||
| 110 | justify-content: space-between; | 135 | justify-content: space-between; |
| 111 | - padding: 40rpx; | ||
| 112 | - background-color: #fff; | 136 | + margin: 24rpx 50rpx; |
| 137 | + font-weight: 700; | ||
| 138 | + font-size: 24rpx; | ||
| 139 | + span { | ||
| 140 | + color: #0FBB59; | ||
| 141 | + font-size: 32rpx | ||
| 142 | + } | ||
| 113 | } | 143 | } |
| 114 | - .zhifuBtn{ | ||
| 115 | - padding: 20rpx 0; | ||
| 116 | - background-color:#3F9B6A; | ||
| 117 | - color: #fff; | ||
| 118 | - text-align: center; | 144 | + .footer-btn { |
| 145 | + display: flex; | ||
| 146 | + .u-btn { | ||
| 147 | + width: 40%; | ||
| 148 | + } | ||
| 119 | } | 149 | } |
| 120 | } | 150 | } |
| 121 | \ No newline at end of file | 151 | \ No newline at end of file |
pages/accepting/accepting.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | - | ||
| 4 | <!-- 记录列表 --> | 3 | <!-- 记录列表 --> |
| 5 | <view class="record-list"> | 4 | <view class="record-list"> |
| 6 | - <view class="record-list-box" > | ||
| 7 | - <view class="list"> | ||
| 8 | - <view class="thumb"> | ||
| 9 | - <image :src="$imgUrl('/img/2.jpg')" mode=""></image> | 5 | + <view class="good-item"> |
| 6 | + <view class="img"> | ||
| 7 | + <u-image width="100%" height="100%" :src="$imgUrl('/img/2.jpg')"></u-image> | ||
| 8 | + </view> | ||
| 9 | + <view class="info"> | ||
| 10 | + <view class="title">这里有标题这里有标题这里有...</view> | ||
| 11 | + <view class="info-item" style="margin-bottom: 30rpx;"> | ||
| 12 | + <u-tag text="标签标签" type="success" size="mini"/> | ||
| 13 | + <u-tag text="标签标签" type="success" size="mini"/> | ||
| 10 | </view> | 14 | </view> |
| 11 | - <view class="title-date"> | ||
| 12 | - <view class="date"> | ||
| 13 | - <text>资源名称:{{record.recordName}}</text> | 15 | + <view class="info-item" style="margin-bottom: 24rpx;"> |
| 16 | + <u-image :showLoading="true" src="/static/images/location-icon.png" width="20rpx" height="20rpx"></u-image> | ||
| 17 | + <text>这里有地址这里有地址这里...</text> | ||
| 14 | </view> | 18 | </view> |
| 15 | - <view class="date"> | ||
| 16 | - <text>地址:这里有地址</text> | 19 | + <view class="info-item"> |
| 20 | + <text style="padding-right: 20rpx;">租金:<span>¥1067/月</span></text> | ||
| 21 | + <text>面积:<span>81/m²</span></text> | ||
| 17 | </view> | 22 | </view> |
| 18 | - <view class="date"> | ||
| 19 | - <text>面积:52</text> | ||
| 20 | - </view> | ||
| 21 | - <view class="date"> | ||
| 22 | - 100元/月 | ||
| 23 | - </view> | ||
| 24 | - </view> | ||
| 25 | - <view class="integral"> | ||
| 26 | - <image :src="$imgUrl('/img/right2.png')"></image> | ||
| 27 | - </view> | ||
| 28 | </view> | 23 | </view> |
| 29 | - | ||
| 30 | </view> | 24 | </view> |
| 31 | </view> | 25 | </view> |
| 32 | <view class="msglist"> | 26 | <view class="msglist"> |
| 33 | - <view class="msg_title"> | ||
| 34 | - <view class=""> | ||
| 35 | - 租赁人姓名 | ||
| 36 | - </view> | ||
| 37 | - <view class="msg_body"> | ||
| 38 | - 张三 | ||
| 39 | - </view> | 27 | + <!-- 租赁详情 --> |
| 28 | + <view class="form-item"> | ||
| 29 | + <view class="label">申请时间</view> | ||
| 30 | + <text>2022-02-22 14:00</text> | ||
| 40 | </view> | 31 | </view> |
| 41 | - <view class="msg_title"> | ||
| 42 | - <view class=""> | ||
| 43 | - 身份证号 | ||
| 44 | - </view> | ||
| 45 | - <view class="msg_body"> | ||
| 46 | - 1111111111111111111111111 | ||
| 47 | - </view> | 32 | + <view class="form-item"> |
| 33 | + <view class="label">申请状态</view> | ||
| 34 | + <text>申请中</text> | ||
| 48 | </view> | 35 | </view> |
| 49 | - <view class="msg_title"> | ||
| 50 | - <view class=""> | ||
| 51 | - 联系方式 | ||
| 52 | - </view> | ||
| 53 | - <view class="msg_body"> | ||
| 54 | - 22222222222222 | ||
| 55 | - </view> | 36 | + <view class="form-item"> |
| 37 | + <view class="label">经营用途</view> | ||
| 38 | + <text>火锅店</text> | ||
| 56 | </view> | 39 | </view> |
| 57 | - <view class="msg_title"> | ||
| 58 | - <view class=""> | ||
| 59 | - 意向租期 | ||
| 60 | - </view> | ||
| 61 | - <view class="msg_body"> | ||
| 62 | - 2022-02-22至2023-02-26 | ||
| 63 | - </view> | 40 | + <view class="form-item"> |
| 41 | + <view class="label">意向租期</view> | ||
| 42 | + <text>2022-03-22 至 2024-02-22</text> | ||
| 64 | </view> | 43 | </view> |
| 65 | - <view class="msg_title"> | ||
| 66 | - <view class=""> | ||
| 67 | - 经验用途 | ||
| 68 | - </view> | ||
| 69 | - <view class="msg_body"> | ||
| 70 | - 零售百货店 | ||
| 71 | - </view> | 44 | + <view class="form-item"> |
| 45 | + <view class="label">经营主体</view> | ||
| 46 | + <text>企业</text> | ||
| 72 | </view> | 47 | </view> |
| 73 | - <view class="msg_title"> | ||
| 74 | - <view class=""> | ||
| 75 | - 经营类型 | ||
| 76 | - </view> | ||
| 77 | - <view class="msg_body"> | ||
| 78 | - 个人 | 48 | + <!-- 广告显示 --> |
| 49 | + <view class="form-item" label-top> | ||
| 50 | + <view class="label">广告图片</view> | ||
| 51 | + <view class="img"> | ||
| 52 | + <u-image width="304rpx" height="182rpx" src="/static/images/front-icon.png"></u-image> | ||
| 79 | </view> | 53 | </view> |
| 80 | </view> | 54 | </view> |
| 81 | - <view class="msg_title"> | ||
| 82 | - <view class=""> | ||
| 83 | - 身份证正反面 | ||
| 84 | - </view> | ||
| 85 | - <view class="msg_body imgGroup"> | ||
| 86 | - <image :src="$imgUrl('/组 18072.png')" mode=""></image> | ||
| 87 | - <image :src="$imgUrl('/组 18072.png')" mode=""></image> | ||
| 88 | - </view> | 55 | + </view> |
| 56 | + <view class="msglist"> | ||
| 57 | + <view class="form-item"> | ||
| 58 | + <view class="label">经营者姓名</view> | ||
| 59 | + <text>张三</text> | ||
| 89 | </view> | 60 | </view> |
| 90 | - <view class="state"> | ||
| 91 | - <text :class="record.state == '受理中'?'org':'green'">{{record.state}}</text> | 61 | + <view class="form-item"> |
| 62 | + <view class="label">证件类型</view> | ||
| 63 | + <text>身份证</text> | ||
| 92 | </view> | 64 | </view> |
| 93 | - </view> | ||
| 94 | - <view class="" style="padding: 0 40rpx;" v-if="record.state == '已通过'"> | ||
| 95 | - <view class="" style="background-color: #3F699A;color: #fff;padding: 14rpx 0;text-align: center;font-size: 28rpx;"> | ||
| 96 | - <text>点击查看签约合约</text> | 65 | + <view class="form-item"> |
| 66 | + <view class="label">身份证号码</view> | ||
| 67 | + <text>1646448898498</text> | ||
| 97 | </view> | 68 | </view> |
| 98 | - </view> | ||
| 99 | - <view class="footbtn" v-if="record.state == '已通过'"> | ||
| 100 | - <view class="zhifu"> | ||
| 101 | - <view class="" style="color: #909090;"> | ||
| 102 | - 合计 | 69 | + <view class="form-item"> |
| 70 | + <view class="label">身份证有效期</view> | ||
| 71 | + <text>2022-03-22 至 2024-02-22</text> | ||
| 72 | + </view> | ||
| 73 | + <view class="form-item" label-top> | ||
| 74 | + <view class="label">身份证照片</view> | ||
| 75 | + <view class="deom-box"> | ||
| 76 | + <view class="img-deom"> | ||
| 77 | + <u-image width="304rpx" height="182rpx" src="/static/images/front-icon.png"></u-image> | ||
| 78 | + </view> | ||
| 79 | + <view class="img-deom"> | ||
| 80 | + <u-image width="304rpx" height="182rpx" src="/static/images/back-icon.png"></u-image> | ||
| 81 | + </view> | ||
| 103 | </view> | 82 | </view> |
| 104 | - <view class="" style="font-weight: 600;"> | ||
| 105 | - 1896.00元/4天 | 83 | + </view> |
| 84 | + <view class="form-item" label-top> | ||
| 85 | + <view class="label">企业授权书</view> | ||
| 86 | + <view class="img"> | ||
| 87 | + <u-image width="304rpx" height="182rpx" src="/static/images/front-icon.png"></u-image> | ||
| 106 | </view> | 88 | </view> |
| 107 | </view> | 89 | </view> |
| 108 | - <view class="zhifuBtn"> | ||
| 109 | - 立即支付 | 90 | + </view> |
| 91 | + <view style="height: 180rpx;" v-if="record.state == '已通过'"></view> | ||
| 92 | + <view class="footbtn" v-if="record.state == '已通过'"> | ||
| 93 | + <view class="info-total"> | ||
| 94 | + <view>租期:<span>2年</span></view> | ||
| 95 | + <view>租金:<span>1067/月</span></view> | ||
| 96 | + <view>合计:<span>10,646.00元</span></view> | ||
| 97 | + </view> | ||
| 98 | + <view class="footer-btn"> | ||
| 99 | + <u-button type="primary" shape="circle">查看合同</u-button> | ||
| 100 | + <u-button type="success" shape="circle">立即支付</u-button> | ||
| 110 | </view> | 101 | </view> |
| 111 | </view> | 102 | </view> |
| 112 | </view> | 103 | </view> |
pages/advertisementAdd/advertisementAdd.vue
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | <u-form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> | 8 | <u-form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> |
| 9 | <view class="add-list"> | 9 | <view class="add-list"> |
| 10 | <u-form-item label="投放时段" prop="name" borderBottom> | 10 | <u-form-item label="投放时段" prop="name" borderBottom> |
| 11 | - <u-input v-model="model1.name" ></u-input> | 11 | + <u-input v-model="model1.name" type="select" @click="toChangeTime"></u-input> |
| 12 | </u-form-item> | 12 | </u-form-item> |
| 13 | </view> | 13 | </view> |
| 14 | <view class="add-list"> | 14 | <view class="add-list"> |
| @@ -187,6 +187,11 @@ | @@ -187,6 +187,11 @@ | ||
| 187 | url: '/pages/record/record' | 187 | url: '/pages/record/record' |
| 188 | }) | 188 | }) |
| 189 | }, | 189 | }, |
| 190 | + toChangeTime(val) { | ||
| 191 | + uni.navigateTo({ | ||
| 192 | + url: `/pages/advertisementTime/advertisementTime?val=${val}` | ||
| 193 | + }) | ||
| 194 | + }, | ||
| 190 | // 上一步 | 195 | // 上一步 |
| 191 | toBefor() { | 196 | toBefor() { |
| 192 | this.active = +this.active - 1; | 197 | this.active = +this.active - 1; |
pages/advertisementDetail/advertisementDetail.vue
| @@ -7,8 +7,8 @@ | @@ -7,8 +7,8 @@ | ||
| 7 | </view> | 7 | </view> |
| 8 | <view class="info-text">{{tableData.shopDescription}}</view> | 8 | <view class="info-text">{{tableData.shopDescription}}</view> |
| 9 | <view class="info-racord"> | 9 | <view class="info-racord"> |
| 10 | - <view class="info-price"><span>4800</span>元/月</view> | ||
| 11 | - <view class="info-intention">10人有意向</view> | 10 | + <view class="info-price"><span>1000</span>元/月</view> |
| 11 | + <view class="info-intention">2456人有意向</view> | ||
| 12 | </view> | 12 | </view> |
| 13 | </view> | 13 | </view> |
| 14 | <view class="banner-item field"> | 14 | <view class="banner-item field"> |
| @@ -71,9 +71,9 @@ | @@ -71,9 +71,9 @@ | ||
| 71 | <text>客服</text> | 71 | <text>客服</text> |
| 72 | </view> | 72 | </view> |
| 73 | <view class="footer-btn"> | 73 | <view class="footer-btn"> |
| 74 | - <u-button type="primary">意向申请</u-button> | ||
| 75 | - <u-button type="success" style="margin-left: unset;" @click="leaseAdd">租赁申请</u-button> | ||
| 76 | - | 74 | + <u-button type="primary" @click="leaseAdd('/pages/intentionApply/intentionApply')">意向申请</u-button> |
| 75 | + <u-button type="success" style="margin-left: unset;" @click="leaseAdd('/pages/advertisementAdd/advertisementAdd')">租赁申请</u-button> | ||
| 76 | + <!-- <u-button type="success" style="margin-left: unset;" @click="leaseAdd">广告申请</u-button> --> | ||
| 77 | </view> | 77 | </view> |
| 78 | <view class="footer-service"> | 78 | <view class="footer-service"> |
| 79 | <u-image :showLoading="true" src="/static/images/share-icon.png" width="30rpx" height="30rpx"></u-image> | 79 | <u-image :showLoading="true" src="/static/images/share-icon.png" width="30rpx" height="30rpx"></u-image> |
| @@ -106,11 +106,11 @@ export default { | @@ -106,11 +106,11 @@ export default { | ||
| 106 | console.log(this.tableData); | 106 | console.log(this.tableData); |
| 107 | }, | 107 | }, |
| 108 | methods: { | 108 | methods: { |
| 109 | - leaseAdd(){ | ||
| 110 | - uni.navigateTo({ | ||
| 111 | - url: '/pages/advertisementAdd/advertisementAdd', | ||
| 112 | - }) | ||
| 113 | - } | 109 | + leaseAdd(url){ |
| 110 | + uni.navigateTo({ | ||
| 111 | + url | ||
| 112 | + }) | ||
| 113 | + } | ||
| 114 | } | 114 | } |
| 115 | }; | 115 | }; |
| 116 | </script> | 116 | </script> |
pages/advertisementTime/advertisementTime.scss
| @@ -3,20 +3,47 @@ | @@ -3,20 +3,47 @@ | ||
| 3 | left: 0; | 3 | left: 0; |
| 4 | top: 0; | 4 | top: 0; |
| 5 | width: 100%; | 5 | width: 100%; |
| 6 | - height: 100%; | 6 | + overflow-y: scroll; |
| 7 | + height: calc(100% - 120rpx); | ||
| 8 | + background-color: #f6f6f6; | ||
| 7 | } | 9 | } |
| 8 | -.calendar { | ||
| 9 | - margin-top: 20rpx; | 10 | +.calendar-box { |
| 11 | + margin: 20rpx; | ||
| 12 | + background-color: #fff; | ||
| 13 | + border-radius: 14rpx; | ||
| 14 | + overflow: hidden; | ||
| 15 | + .wn-calendar { | ||
| 16 | + .labels { | ||
| 17 | + background-color: #fff; | ||
| 18 | + } | ||
| 19 | + } | ||
| 20 | +} | ||
| 21 | +.form-box { | ||
| 22 | + padding: 0 20rpx; | ||
| 23 | + .add-list{ | ||
| 24 | + padding: 0 4%; | ||
| 25 | + background-color: #FFFFFF; | ||
| 26 | + border-radius: 20rpx; | ||
| 27 | + margin-top: 20rpx; | ||
| 28 | + width: 100%; | ||
| 29 | + } | ||
| 30 | + .btns { | ||
| 31 | + display: flex; | ||
| 32 | + margin-top: 20rpx; | ||
| 33 | + .u-btn { | ||
| 34 | + padding: 0 60rpx; | ||
| 35 | + } | ||
| 36 | + } | ||
| 10 | } | 37 | } |
| 11 | /* 保存按钮 */ | 38 | /* 保存按钮 */ |
| 12 | .page-footer{ | 39 | .page-footer{ |
| 13 | position: fixed; | 40 | position: fixed; |
| 14 | left: 0; | 41 | left: 0; |
| 15 | bottom: 0; | 42 | bottom: 0; |
| 16 | - display: flex; | ||
| 17 | width: 100%; | 43 | width: 100%; |
| 18 | - height: 100rpx; | 44 | + height: 120rpx; |
| 19 | background-color: #FFFFFF; | 45 | background-color: #FFFFFF; |
| 46 | + padding: 20rpx 20rpx; | ||
| 20 | padding-bottom: constant(safe-area-inset-bottom); | 47 | padding-bottom: constant(safe-area-inset-bottom); |
| 21 | padding-bottom: env(safe-area-inset-bottom); | 48 | padding-bottom: env(safe-area-inset-bottom); |
| 22 | .footer-buy{ | 49 | .footer-buy{ |
| @@ -30,7 +57,7 @@ | @@ -30,7 +57,7 @@ | ||
| 30 | align-items: center; | 57 | align-items: center; |
| 31 | justify-content: center; | 58 | justify-content: center; |
| 32 | width: 100%; | 59 | width: 100%; |
| 33 | - height: 100rpx; | 60 | + height: 70rpx; |
| 34 | background-color: #3f9b6a; | 61 | background-color: #3f9b6a; |
| 35 | text{ | 62 | text{ |
| 36 | font-size: 28rpx; | 63 | font-size: 28rpx; |
pages/advertisementTime/advertisementTime.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | - <view class="calendar"> | ||
| 4 | - <calendar ref="calendar" v-if="isShow" @cancel="cancel" :startDate="startDate" :height="height" :endDate="endDate" @selectDate="selectDate" :limit="limit" :bottom1="bottom1" :yimanArray="yimanArray" /> | 3 | + <view class="calendar-box"> |
| 4 | + <wn-calendar | ||
| 5 | + ref="calendar" | ||
| 6 | + :data="[{date:'2024/10/25', text:'显示文本', type: 2}]" | ||
| 7 | + :isBorder="false" | ||
| 8 | + :isLess="false" | ||
| 9 | + :colors="['#f3a73f', '#2979ff', '#8f939c', '#18bc37', '#e43d33']" | ||
| 10 | + :isEn="false" | ||
| 11 | + format="/" | ||
| 12 | + ></wn-calendar> | ||
| 5 | </view> | 13 | </view> |
| 6 | - <!-- 保存按钮 --> | 14 | + <u-form class="form-box" labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> |
| 15 | + <view class="add-list"> | ||
| 16 | + <u-form-item label="开始时间" prop="val" borderBottom> | ||
| 17 | + <u-input v-model="model1.val" ></u-input> | ||
| 18 | + </u-form-item> | ||
| 19 | + </view> | ||
| 20 | + <view class="add-list"> | ||
| 21 | + <u-form-item label="结束时间" prop="val" borderBottom> | ||
| 22 | + <u-input v-model="model1.val" ></u-input> | ||
| 23 | + </u-form-item> | ||
| 24 | + </view> | ||
| 25 | + <view class="btns"> | ||
| 26 | + <u-button size="medium">1天</u-button> | ||
| 27 | + <u-button size="medium">2天</u-button> | ||
| 28 | + <u-button size="medium">3天</u-button> | ||
| 29 | + <u-button size="medium">4天</u-button> | ||
| 30 | + </view> | ||
| 31 | + </u-form> | ||
| 32 | + <view style="height: 120rpx;"></view> | ||
| 7 | <view class="page-footer"> | 33 | <view class="page-footer"> |
| 8 | - <view class="footer-buy" @click="advertisementAdd"> | ||
| 9 | - <view class="cart-add"> | ||
| 10 | - <text>下一步</text> | ||
| 11 | - </view> | ||
| 12 | - </view> | 34 | + <u-button type="success">确定</u-button> |
| 13 | </view> | 35 | </view> |
| 14 | </view> | 36 | </view> |
| 15 | </template> | 37 | </template> |
| 16 | 38 | ||
| 17 | <script> | 39 | <script> |
| 18 | - // import calendar from '@/components/fl-calendar1/fl-calendar1.vue' | ||
| 19 | - import calendar from '@/components/dc-calendar/dc-calendar.vue' | ||
| 20 | - export default { | ||
| 21 | - components: { | ||
| 22 | - | ||
| 23 | - calendar | ||
| 24 | - | ||
| 25 | - }, | ||
| 26 | - | ||
| 27 | - data() { | ||
| 28 | - return { | ||
| 29 | - isShow:false, | ||
| 30 | - startDate:'', //开始日期2022-01-26 | ||
| 31 | - endDate:'', //结束日期 2022-01-29 | ||
| 32 | - height:600, //日历容器高度 | ||
| 33 | - limit:12, //展示月份数量 | ||
| 34 | - bottom1:0, | ||
| 35 | - yimanArray:[], | ||
| 36 | - dicdes:{ | ||
| 37 | - price:1 | ||
| 38 | - },//传过来的订单数据 | ||
| 39 | - type:0,//1是进入订单 0是返回 | ||
| 40 | - | ||
| 41 | - } | ||
| 42 | - }, | ||
| 43 | - mounted() { | ||
| 44 | - | ||
| 45 | - }, | ||
| 46 | - onUnload() { | ||
| 47 | - uni.setStorageSync('满日期显示',0) | ||
| 48 | - | ||
| 49 | - }, | ||
| 50 | - onLoad(e) { | ||
| 51 | - | ||
| 52 | - uni.showLoading({ | ||
| 53 | - title: '加载中' | ||
| 54 | - }); | ||
| 55 | - | ||
| 56 | - let sys = uni.getSystemInfoSync(); | ||
| 57 | - if (sys.statusBarHeight >=44) { | ||
| 58 | - // this.height = sys.windowHeight - 34; | ||
| 59 | - this.bottom1 = 34; | ||
| 60 | - } else{ | ||
| 61 | - // this.height = sys.windowHeight; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - // console.log(sys); | ||
| 65 | - | ||
| 66 | - var dicday = uni.getStorageSync('入离日期'); | ||
| 67 | - if(dicday){ | ||
| 68 | - this.startDate = dicday.startDate; | ||
| 69 | - this.endDate = dicday.endDate; | ||
| 70 | - } | ||
| 71 | - this.newdate(); | ||
| 72 | - | ||
| 73 | - this.type = 1; | ||
| 74 | - // this.dicdes = JSON.parse(e.dic); | ||
| 75 | - uni.setStorageSync('满日期显示',1) | ||
| 76 | - // //取房间满房日期 | ||
| 77 | - this.gethttpurl(this.dicdes.id); | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - | ||
| 81 | - }, | ||
| 82 | - methods: { | ||
| 83 | - advertisementAdd() { | ||
| 84 | - uni.navigateTo({ | ||
| 85 | - url: '/pages/advertisementAdd/advertisementAdd' | ||
| 86 | - }) | ||
| 87 | - }, | ||
| 88 | - //取房间满房日期 | ||
| 89 | - gethttpurl(id){ | ||
| 90 | - | ||
| 91 | - this.yimanArray =['2022-03-25','2022-04-10']; | ||
| 92 | - this.isShow = true; | ||
| 93 | - uni.hideLoading(); | ||
| 94 | - | ||
| 95 | - | ||
| 96 | - }, | ||
| 97 | - | ||
| 98 | - | ||
| 99 | - // 展示选择器 | ||
| 100 | - showCalendar() { | ||
| 101 | - this.isShow = true | ||
| 102 | - }, | ||
| 103 | - // 隐藏选择器 | ||
| 104 | - cancel(){ | ||
| 105 | - this.isShow=false | ||
| 106 | - }, | ||
| 107 | - // 获取传参 | ||
| 108 | - selectDate(data) { | ||
| 109 | - console.log('拿到传参', data) | ||
| 110 | - uni.setStorageSync('入离日期',data); | ||
| 111 | - | ||
| 112 | - | ||
| 113 | - | ||
| 114 | - }, | ||
| 115 | - // 获取当日的 年-月-日 | ||
| 116 | - newdate() { | ||
| 117 | - let date = new Date() | ||
| 118 | - let year = date.getFullYear() | ||
| 119 | - let month = date.getMonth() + 1 | ||
| 120 | - let week = date.getDay() | ||
| 121 | - let day = date.getDate() | ||
| 122 | - var days = new Date(year, month, 0).getDate(); //总共多少天 | ||
| 123 | - // console.log(days,day); | ||
| 124 | - month = month < 10 ? '0' + month : month | ||
| 125 | - day = day < 10 ? '0' + day : day | ||
| 126 | - let today = `${year}-${month}-${day}`; | ||
| 127 | - let todayend = `${year}-${month}-${day}`; | ||
| 128 | - let today1 = `${month}月${day}日`; | ||
| 129 | - let today1end = `${month}月${day}日`; | ||
| 130 | - //加年 | ||
| 131 | - if (month == 12 && parseInt(day) == parseInt(days)) { | ||
| 132 | - | ||
| 133 | - let day01 = '01'; | ||
| 134 | - let month01 = '01'; | ||
| 135 | - let year01 = parseInt(year) + 1; | ||
| 136 | - todayend = `${year01}-${month01}-${day01}`; | ||
| 137 | - today1end = `${year01}年${month01}月${day01}日`; | ||
| 138 | - } else if (parseInt(day) == parseInt(days)) { | ||
| 139 | - //加月 | ||
| 140 | - let day01 = '01'; | ||
| 141 | - let month01 = parseInt(month) + 1; | ||
| 142 | - month01 = month01 < 10 ? '0' + month01 : month01 | ||
| 143 | - todayend = `${year}-${month01}-${day01}`; | ||
| 144 | - today1end = `${month01}月${day01}日`; | ||
| 145 | - | ||
| 146 | - } else { | ||
| 147 | - //加天数 | ||
| 148 | - let day01 = parseInt(day) + 1; | ||
| 149 | - day01 = day01 < 10 ? '0' + day01 : day01 | ||
| 150 | - todayend = `${year}-${month}-${day01}`; | ||
| 151 | - today1end = `${month}月${day01}日`; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - let dicday = { | ||
| 155 | - startDate: today, | ||
| 156 | - endDate: todayend, | ||
| 157 | - startDate1: today1, | ||
| 158 | - endDate1: today1end, | ||
| 159 | - dayNum: '1' | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - this.startDate = dicday.startDate; | ||
| 163 | - this.endDate = dicday.endDate; | ||
| 164 | - uni.setStorageSync('入离日期', dicday); | ||
| 165 | - // console.log(this.dicday); | ||
| 166 | - }, | ||
| 167 | - } | ||
| 168 | - } | 40 | + export default { |
| 41 | + data() { | ||
| 42 | + return { | ||
| 43 | + model1: { | ||
| 44 | + val: '', | ||
| 45 | + }, | ||
| 46 | + rules: {}, | ||
| 47 | + } | ||
| 48 | + }, | ||
| 49 | + methods: { | ||
| 50 | + // 点击日数方法 | ||
| 51 | + clickActive({year, month, date, index}){ | ||
| 52 | + console.log(year, month, date, index) | ||
| 53 | + }, | ||
| 54 | + | ||
| 55 | + // 点击任务方法 | ||
| 56 | + clickTask({row, index}){ | ||
| 57 | + console.log(row, index) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 169 | </script> | 61 | </script> |
| 170 | 62 | ||
| 171 | -<style scoped lang="scss"> | 63 | +<style> |
| 172 | @import 'advertisementTime.scss'; | 64 | @import 'advertisementTime.scss'; |
| 173 | -</style> | 65 | -</style> |
| 66 | +</style> | ||
| 174 | \ No newline at end of file | 67 | \ No newline at end of file |
pages/business/businessList/businessList.scss
pages/createQuestionnaire/createQuestionnaire.scss
| 1 | .page{ | 1 | .page{ |
| 2 | - padding: 20rpx 30rpx; | ||
| 3 | - background-color: #fff; | 2 | + padding: 0 20rpx 20rpx; |
| 3 | + background-color: #f6f6f6; | ||
| 4 | font-size: 24rpx; | 4 | font-size: 24rpx; |
| 5 | font-weight: 500; | 5 | font-weight: 500; |
| 6 | position: relative; | 6 | position: relative; |
| 7 | - .titles{ | ||
| 8 | - display: flex; | ||
| 9 | - justify-content: space-between; | ||
| 10 | - margin-bottom: 30rpx; | ||
| 11 | - } | ||
| 12 | - .uni-textarea{ | ||
| 13 | - | ||
| 14 | - padding: 20rpx 30rpx; | ||
| 15 | - min-height: 50rpx; | ||
| 16 | - font-size: 24rpx; | ||
| 17 | - background-color: #EFEFEF; | ||
| 18 | - /deep/ uni-textarea{ | ||
| 19 | - height: 180rpx; | ||
| 20 | - } | ||
| 21 | - /deep/.textarea{ | ||
| 22 | - width: 100%; | ||
| 23 | - font-size: 24rpx; | ||
| 24 | - | ||
| 25 | - } | 7 | + .form-box { |
| 8 | + padding: 0 4%; | ||
| 9 | + background-color: #FFFFFF; | ||
| 10 | + border-radius: 20rpx; | ||
| 11 | + margin-top: 20rpx; | ||
| 12 | + width: 100%; | ||
| 26 | } | 13 | } |
| 27 | - .listCont{ | ||
| 28 | - margin-top: 60rpx; | ||
| 29 | - .listTitile{ | ||
| 30 | - margin-bottom: 20rpx; | ||
| 31 | - } | ||
| 32 | - .uni-input{ | ||
| 33 | - background-color: #E0E0E0; | ||
| 34 | - margin-bottom: 20rpx; | ||
| 35 | - height: 80rpx; | ||
| 36 | - padding: 10rpx 20rpx; | ||
| 37 | - font-size: 24rpx; | 14 | + .select-item { |
| 15 | + background-color: #FFFFFF; | ||
| 16 | + border-radius: 20rpx; | ||
| 17 | + margin-top: 20rpx; | ||
| 18 | + width: 100%; | ||
| 19 | + .top { | ||
| 20 | + padding: 22rpx 4%; | ||
| 21 | + .title { | ||
| 22 | + font-size: 30rpx; | ||
| 23 | + margin-bottom: 20rpx; | ||
| 24 | + } | ||
| 25 | + .radio-box { | ||
| 26 | + font-size: 24rpx; | ||
| 27 | + color: #7c7c7c; | ||
| 28 | + } | ||
| 38 | } | 29 | } |
| 39 | - .btnList{ | 30 | + .bottom { |
| 31 | + padding: 20rpx 4%; | ||
| 40 | display: flex; | 32 | display: flex; |
| 41 | - flex-wrap: wrap; | ||
| 42 | - font-weight: 200; | ||
| 43 | - background-color: #E0E0E0; | ||
| 44 | - padding: 14rpx 14rpx; | ||
| 45 | - justify-content: space-between; | ||
| 46 | - /deep/ uni-button{ | 33 | + background-color: #EDFFF5; |
| 34 | + border: #0FBB59 solid 1rpx; | ||
| 35 | + border-radius: 0 0 20rpx 20rpx; | ||
| 36 | + .u-btn { | ||
| 47 | width: 18%; | 37 | width: 18%; |
| 48 | - height:45rpx; | ||
| 49 | - font-size: 24rpx; | ||
| 50 | - border-radius:none; | ||
| 51 | - line-height: 45rpx; | 38 | + } |
| 39 | + :first-child { | ||
| 40 | + margin-left: 0; | ||
| 41 | + } | ||
| 42 | + :last-child { | ||
| 43 | + margin-right: 0; | ||
| 52 | } | 44 | } |
| 53 | } | 45 | } |
| 54 | } | 46 | } |
| 55 | - .page_foot{ | 47 | + .page-footer{ |
| 56 | position: fixed; | 48 | position: fixed; |
| 49 | + left: 0; | ||
| 57 | bottom: 0; | 50 | bottom: 0; |
| 58 | - left: 0; | 51 | + display: flex; |
| 52 | + flex-direction: row; | ||
| 53 | + align-items: center; | ||
| 54 | + justify-content: space-between; | ||
| 59 | width: 100%; | 55 | width: 100%; |
| 60 | - z-index: 10; | ||
| 61 | - .foot_btnList{ | ||
| 62 | - display: flex; | ||
| 63 | - flex-wrap: wrap; | ||
| 64 | - font-weight: 200; | ||
| 65 | - padding: 14rpx 30rpx; | ||
| 66 | - justify-content: space-between; | ||
| 67 | - /deep/ uni-button{ | ||
| 68 | - width: 21%; | ||
| 69 | - height:70rpx; | ||
| 70 | - font-size: 24rpx; | ||
| 71 | - border-radius:none; | ||
| 72 | - line-height: 70rpx; | ||
| 73 | - } | 56 | + height: 120rpx; |
| 57 | + background-color: #FFFFFF; | ||
| 58 | + padding-bottom: constant(safe-area-inset-bottom); | ||
| 59 | + padding-bottom: env(safe-area-inset-bottom); | ||
| 60 | + .u-btn { | ||
| 61 | + width: 30%; | ||
| 62 | + } | ||
| 63 | + .u-icon { | ||
| 64 | + margin-right: 10rpx; | ||
| 74 | } | 65 | } |
| 75 | } | 66 | } |
| 76 | } | 67 | } |
| 77 | \ No newline at end of file | 68 | \ No newline at end of file |
pages/createQuestionnaire/createQuestionnaire.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | - <view class="" style="margin-top: 20rpx;"> | ||
| 4 | - <view class="titles"> | ||
| 5 | - <view>问卷名称</view> | ||
| 6 | - <view>这里有名称</view> | ||
| 7 | - </view> | ||
| 8 | - <view class="" style="margin-bottom: 20rpx;"> | ||
| 9 | - 问卷说明 | 3 | + <u-form :model="form" ref="uForm" :label-width="120"> |
| 4 | + <view class="form-box"> | ||
| 5 | + <u-form-item label="问卷名称"><u-input v-model="form.name" /></u-form-item> | ||
| 10 | </view> | 6 | </view> |
| 11 | - <view class="uni-textarea"> | ||
| 12 | - <textarea placeholder-style="color:#A2A2A2" placeholder="请输入" placeholder-class="textarea"/> | ||
| 13 | - </view> | ||
| 14 | - <view class="listCont"> | ||
| 15 | - <view class="listTitile"> | ||
| 16 | - 1.这里有标题 | ||
| 17 | - </view> | ||
| 18 | - <view class=""> | ||
| 19 | - <radio-group> | ||
| 20 | - <view> <label class="radio"><radio value="r1" checked="true" style="transform:scale(0.5)"/>这里有选项这里有选项</label></view> | ||
| 21 | - <view><label class="radio"><radio value="r2" style="transform:scale(0.5)" />这里有选项这里有选项</label></view> | ||
| 22 | - </radio-group> | ||
| 23 | - | ||
| 24 | - </view> | ||
| 25 | - <view style="margin: 20rpx 0;"> | ||
| 26 | - <view class="btnList"> | ||
| 27 | - <button>编辑</button><button>复制</button><button>上移</button><button>下移</button><button>删除</button> | ||
| 28 | - </view> | ||
| 29 | - </view> | 7 | + <view class="form-box"> |
| 8 | + <u-form-item label="问卷说明" label-position="top"><u-input v-model="form.name" type="textarea"/></u-form-item> | ||
| 30 | </view> | 9 | </view> |
| 31 | - <view class="listCont"> | ||
| 32 | - <view class="listTitile"> | ||
| 33 | - 1.这里有标题 | ||
| 34 | - </view> | ||
| 35 | - <view class="" style="padding:0 20rpx;"> | ||
| 36 | - <input class="uni-input" placeholder="请输入" /> | ||
| 37 | - </view> | ||
| 38 | - <view> | ||
| 39 | - <view class="btnList"> | ||
| 40 | - <button>编辑</button><button>复制</button><button>上移</button><button>下移</button><button>删除</button> | 10 | + <view class="select-item" v-for="i in 2" :key="2"> |
| 11 | + <view class="top"> | ||
| 12 | + <view class="title"> | ||
| 13 | + 1.这里有标题这里有标题这里有标题 | ||
| 41 | </view> | 14 | </view> |
| 15 | + <u-radio-group class="radio-box"> | ||
| 16 | + <u-radio shape="circle">这里有选项这里有选项</u-radio> | ||
| 17 | + <u-radio shape="circle">这里有选项这里有选项</u-radio> | ||
| 18 | + </u-radio-group> | ||
| 42 | </view> | 19 | </view> |
| 43 | - </view> | ||
| 44 | - <view class="page_foot"> | ||
| 45 | - | ||
| 46 | - <view class="foot_btnList"> | ||
| 47 | - <button>添加题目</button><button>设置</button><button>预览</button><button>提交</button> | 20 | + <view class="bottom"> |
| 21 | + <u-button type="primary" size="mini">编辑</u-button> | ||
| 22 | + <u-button type="success" size="mini">复制</u-button> | ||
| 23 | + <u-button type="success" size="mini">上移</u-button> | ||
| 24 | + <u-button type="success" size="mini">下移</u-button> | ||
| 25 | + <u-button type="error" size="mini">删除</u-button> | ||
| 48 | </view> | 26 | </view> |
| 49 | </view> | 27 | </view> |
| 50 | - </view> | ||
| 51 | - | 28 | + </u-form> |
| 29 | + <view class="page-footer"> | ||
| 30 | + <u-button type="info"><u-icon name="setting"></u-icon>设置</u-button> | ||
| 31 | + <u-button type="info"><u-icon name="eye"></u-icon>预览</u-button> | ||
| 32 | + <u-button type="success"><u-icon name="checkmark-circle"></u-icon>提交</u-button> | ||
| 33 | + </view> | ||
| 52 | </view> | 34 | </view> |
| 53 | </template> | 35 | </template> |
| 54 | 36 | ||
| @@ -56,6 +38,9 @@ | @@ -56,6 +38,9 @@ | ||
| 56 | export default { | 38 | export default { |
| 57 | data() { | 39 | data() { |
| 58 | return { | 40 | return { |
| 41 | + form: { | ||
| 42 | + name: '', | ||
| 43 | + }, | ||
| 59 | value:0 | 44 | value:0 |
| 60 | }; | 45 | }; |
| 61 | }, | 46 | }, |
pages/details/details.vue
| @@ -93,9 +93,9 @@ | @@ -93,9 +93,9 @@ | ||
| 93 | <text>客服</text> | 93 | <text>客服</text> |
| 94 | </view> | 94 | </view> |
| 95 | <view class="footer-btn"> | 95 | <view class="footer-btn"> |
| 96 | - <u-button type="primary">意向申请</u-button> | ||
| 97 | - <u-button type="success" style="margin-left: unset;" @click="leaseAdd">租赁申请</u-button> | ||
| 98 | - | 96 | + <u-button type="primary" @click="leaseAdd('/pages/intentionApply/intentionApply')">意向申请</u-button> |
| 97 | + <u-button type="success" style="margin-left: unset;" @click="leaseAdd('/pages/leaseAdd/leaseAdd')">租赁申请</u-button> | ||
| 98 | + <!-- <u-button type="success" style="margin-left: unset;" @click="leaseAdd">广告申请</u-button> --> | ||
| 99 | </view> | 99 | </view> |
| 100 | <view class="footer-service"> | 100 | <view class="footer-service"> |
| 101 | <u-image :showLoading="true" src="/static/images/share-icon.png" width="30rpx" height="30rpx"></u-image> | 101 | <u-image :showLoading="true" src="/static/images/share-icon.png" width="30rpx" height="30rpx"></u-image> |
| @@ -132,9 +132,9 @@ export default { | @@ -132,9 +132,9 @@ export default { | ||
| 132 | console.log(this.swiperList, this.tableData); | 132 | console.log(this.swiperList, this.tableData); |
| 133 | }, | 133 | }, |
| 134 | methods: { | 134 | methods: { |
| 135 | - leaseAdd(){ | 135 | + leaseAdd(url){ |
| 136 | uni.navigateTo({ | 136 | uni.navigateTo({ |
| 137 | - url: '/pages/leaseAdd/leaseAdd' | 137 | + url |
| 138 | }) | 138 | }) |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
pages/intentionApply/intentionApply.scss
0 → 100644
| 1 | +.page{ | ||
| 2 | + position: absolute; | ||
| 3 | + left: 0; | ||
| 4 | + top: 0; | ||
| 5 | + width: 100%; | ||
| 6 | + overflow-y: scroll; | ||
| 7 | + height: calc(100% - 120rpx); | ||
| 8 | + background-color: #f6f6f6; | ||
| 9 | +} | ||
| 10 | +.steps-box { | ||
| 11 | + padding-top: 40rpx; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +.add-list{ | ||
| 15 | + padding: 0 4%; | ||
| 16 | + background-color: #FFFFFF; | ||
| 17 | + border-radius: 20rpx; | ||
| 18 | + margin-top: 20rpx; | ||
| 19 | + width: 100%; | ||
| 20 | + .list{ | ||
| 21 | + display: flex; | ||
| 22 | + justify-content: space-between; | ||
| 23 | + align-items: center; | ||
| 24 | + width: 100%; | ||
| 25 | + height: 100rpx; | ||
| 26 | + border-bottom: 2rpx solid #f6f6f6; | ||
| 27 | + .title{ | ||
| 28 | + display: flex; | ||
| 29 | + align-items: center; | ||
| 30 | + height: 100%; | ||
| 31 | + text{ | ||
| 32 | + font-size: 26rpx; | ||
| 33 | + color: #222222; | ||
| 34 | + } | ||
| 35 | + .star{ | ||
| 36 | + color: red; | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + .content{ | ||
| 40 | + display: flex; | ||
| 41 | + align-items: center; | ||
| 42 | + text-align: right; | ||
| 43 | + input{ | ||
| 44 | + width: 100%; | ||
| 45 | + color: #222222; | ||
| 46 | + font-size: 26rpx; | ||
| 47 | + padding-top: 6rpx; | ||
| 48 | + /* #ifdef MP */ | ||
| 49 | + padding-top: 5rpx; | ||
| 50 | + /* #endif */ | ||
| 51 | + } | ||
| 52 | + image { | ||
| 53 | + width: 20rpx; | ||
| 54 | + height: 20rpx; | ||
| 55 | + margin-left: 10rpx; | ||
| 56 | + /* #ifdef MP */ | ||
| 57 | + margin-top: 5rpx; | ||
| 58 | + /* #endif */ | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + .deom-box { | ||
| 63 | + width: 100vw; | ||
| 64 | + display: flex !important; | ||
| 65 | + padding: 14rpx 0; | ||
| 66 | + background-color: #FFFFFF; | ||
| 67 | + border-radius: 9px; | ||
| 68 | + // margin-top: 9px; | ||
| 69 | + width: 100%; | ||
| 70 | + // .u-upload { | ||
| 71 | + // .u-add-wrap { | ||
| 72 | + // width: 304rpx !important; | ||
| 73 | + // height: 182rpx !important; | ||
| 74 | + // } | ||
| 75 | + // } | ||
| 76 | + // .u-upload { | ||
| 77 | + // height: 88px; | ||
| 78 | + // width: 155px; | ||
| 79 | + // background: url(/static/images/uploadID1.png); | ||
| 80 | + // background-size:134rpx 188rpx; | ||
| 81 | + // background-repeat:no-repeat; | ||
| 82 | + // } | ||
| 83 | + .img-deom { | ||
| 84 | + flex: 1; | ||
| 85 | + display: flex; | ||
| 86 | + flex-direction: column; | ||
| 87 | + align-items: center; | ||
| 88 | + padding: 20rpx; | ||
| 89 | + text { | ||
| 90 | + margin-top: 18rpx; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | +/* 保存按钮 */ | ||
| 97 | +.page-footer{ | ||
| 98 | + position: fixed; | ||
| 99 | + left: 0; | ||
| 100 | + bottom: 0; | ||
| 101 | + display: flex; | ||
| 102 | + align-items: center; | ||
| 103 | + width: 100%; | ||
| 104 | + height: 125rpx; | ||
| 105 | + background-color: #FFFFFF; | ||
| 106 | + padding-bottom: constant(safe-area-inset-bottom); | ||
| 107 | + padding-bottom: env(safe-area-inset-bottom); | ||
| 108 | + .footer-buy{ | ||
| 109 | + display: flex; | ||
| 110 | + align-items: center; | ||
| 111 | + justify-content: space-between; | ||
| 112 | + width: 100%; | ||
| 113 | + height: 100%; | ||
| 114 | + .cart-add{ | ||
| 115 | + display: flex; | ||
| 116 | + align-items: center; | ||
| 117 | + justify-content: center; | ||
| 118 | + width: 100%; | ||
| 119 | + height: 100rpx; | ||
| 120 | + background-color: #3f9b6a; | ||
| 121 | + text{ | ||
| 122 | + font-size: 28rpx; | ||
| 123 | + color: #FFFFFF; | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +.feedback-data{ | ||
| 130 | + width: 100%; | ||
| 131 | + padding-bottom: 20rpx; | ||
| 132 | + border-bottom: 2rpx solid #f6f6f6; | ||
| 133 | + .title{ | ||
| 134 | + display: flex; | ||
| 135 | + align-items: center; | ||
| 136 | + height: 100rpx; | ||
| 137 | + text{ | ||
| 138 | + font-size: 26rpx; | ||
| 139 | + color: #222222; | ||
| 140 | + } | ||
| 141 | + .star{ | ||
| 142 | + color: red; | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + .voucher-img{ | ||
| 146 | + display: flex; | ||
| 147 | + align-items: center; | ||
| 148 | + .voucher-list { | ||
| 149 | + width: 33%; | ||
| 150 | + height: 100%; | ||
| 151 | + image{ | ||
| 152 | + width: 160rpx; | ||
| 153 | + height: 160rpx; | ||
| 154 | + border-radius: 10rpx; | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | +} | ||
| 0 | \ No newline at end of file | 159 | \ No newline at end of file |
pages/intentionApply/intentionApply.vue
0 → 100644
| 1 | +<template> | ||
| 2 | +</template> | ||
| 3 | + | ||
| 4 | +<script> | ||
| 5 | +</script> | ||
| 6 | + | ||
| 7 | +<style> | ||
| 8 | +</style><template> | ||
| 9 | + <view class="page"> | ||
| 10 | + <view class="steps-box"> | ||
| 11 | + <u-steps :list="numList" :current="active"></u-steps> | ||
| 12 | + </view> | ||
| 13 | + <view> | ||
| 14 | + <view class="add-list" v-if="active == 0"> | ||
| 15 | + <u-form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> | ||
| 16 | + <u-form-item label="租用时段" prop="name" borderBottom> | ||
| 17 | + <u-input v-model="model1.name" ></u-input> | ||
| 18 | + </u-form-item> | ||
| 19 | + <u-form-item label="租期" prop="name" borderBottom> | ||
| 20 | + <u-input v-model="model1.name" ></u-input> | ||
| 21 | + </u-form-item> | ||
| 22 | + <u-form-item label="意向经营类型" prop="name" borderBottom> | ||
| 23 | + <u-input v-model="model1.name" ></u-input> | ||
| 24 | + </u-form-item> | ||
| 25 | + <u-form-item label="意向区域(如有)" prop="name" borderBottom> | ||
| 26 | + <u-input v-model="model1.name" ></u-input> | ||
| 27 | + </u-form-item> | ||
| 28 | + <u-form-item label="意向商铺位置(如有)" prop="name" borderBottom> | ||
| 29 | + <u-input v-model="model1.name" ></u-input> | ||
| 30 | + </u-form-item> | ||
| 31 | + <u-form-item label="意向商铺名称(如有)" prop="name" borderBottom> | ||
| 32 | + <u-input v-model="model1.name" ></u-input> | ||
| 33 | + </u-form-item> | ||
| 34 | + </u-form> | ||
| 35 | + </view> | ||
| 36 | + <view class="add-list" v-else-if='active == 1'> | ||
| 37 | + <u-form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> | ||
| 38 | + <u-form-item label="主体名称" prop="name" borderBottom> | ||
| 39 | + <u-input v-model="model1.name" ></u-input> | ||
| 40 | + </u-form-item> | ||
| 41 | + <u-form-item label="统一社会信用代码" prop="name" borderBottom> | ||
| 42 | + <u-input v-model="model1.name" ></u-input> | ||
| 43 | + </u-form-item> | ||
| 44 | + <u-form-item label="类型" prop="type" borderBottom> | ||
| 45 | + <u-input v-model="model1.type" type="select" @click="model1.typeShow = true" placeholder='请选择类型'/> | ||
| 46 | + <u-select v-model="model1.typeShow" :list="activesType" @confirm="typeChange"></u-select> | ||
| 47 | + </u-form-item> | ||
| 48 | + <u-form-item label="法定代表人" prop="name" borderBottom> | ||
| 49 | + <u-input v-model="model1.name" ></u-input> | ||
| 50 | + </u-form-item> | ||
| 51 | + <u-form-item label="经营范围" prop="name" borderBottom> | ||
| 52 | + <u-input v-model="model1.name" ></u-input> | ||
| 53 | + </u-form-item> | ||
| 54 | + <u-form-item label="注册资本" prop="name" borderBottom> | ||
| 55 | + <u-input v-model="model1.name" ></u-input> | ||
| 56 | + </u-form-item> | ||
| 57 | + <u-form-item label="成立日期" prop="name" borderBottom> | ||
| 58 | + <u-input v-model="model1.name" ></u-input> | ||
| 59 | + </u-form-item> | ||
| 60 | + <u-form-item label="住所" prop="name" borderBottom> | ||
| 61 | + <u-input v-model="model1.name" ></u-input> | ||
| 62 | + </u-form-item> | ||
| 63 | + <u-form-item label="邮箱地址" prop="name" borderBottom> | ||
| 64 | + <u-input v-model="model1.name" ></u-input> | ||
| 65 | + </u-form-item> | ||
| 66 | + <u-form-item label="经营期限" prop="name" borderBottom> | ||
| 67 | + <u-input v-model="model1.name" ></u-input> | ||
| 68 | + </u-form-item> | ||
| 69 | + <u-form-item label="营业执照" prop="name" borderBottom labelPosition="top"> | ||
| 70 | + <u-upload :active="active" :file-list="model1.fileList" ></u-upload> | ||
| 71 | + </u-form-item> | ||
| 72 | + </u-form> | ||
| 73 | + </view> | ||
| 74 | + <view v-else> | ||
| 75 | + <u-form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> | ||
| 76 | + <view class="add-list"> | ||
| 77 | + <u-form-item label="经营者姓名" prop="name" borderBottom> | ||
| 78 | + <u-input v-model="model1.name" ></u-input> | ||
| 79 | + </u-form-item> | ||
| 80 | + <u-form-item label="证件类型" prop="type" borderBottom> | ||
| 81 | + <u-input v-model="model1.type" type="select" @click="model1.typeShow = true" placeholder='请选择类型'/> | ||
| 82 | + <u-select v-model="model1.typeShow" :list="activesType" @confirm="typeChange"></u-select> | ||
| 83 | + </u-form-item> | ||
| 84 | + <u-form-item label="身份证号码" prop="name" borderBottom> | ||
| 85 | + <u-input v-model="model1.name" ></u-input> | ||
| 86 | + </u-form-item> | ||
| 87 | + <u-form-item label="身份证有效期" prop="name" borderBottom> | ||
| 88 | + <u-input v-model="model1.name" ></u-input> | ||
| 89 | + </u-form-item> | ||
| 90 | + </view> | ||
| 91 | + <view class="add-list"> | ||
| 92 | + <view class="deom-box"> | ||
| 93 | + <view class="img-deom"> | ||
| 94 | + <u-upload :active="active" :file-list="model1.fileList" :custom-btn="true" :max-count="1"> | ||
| 95 | + <view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> | ||
| 96 | + <u-image width="304rpx" height="182rpx" src="/static/images/uploadID1.png"></u-image> | ||
| 97 | + </view> | ||
| 98 | + </u-upload> | ||
| 99 | + <text>点击上传证件人像面</text> | ||
| 100 | + </view> | ||
| 101 | + <view class="img-deom"> | ||
| 102 | + <u-upload :active="active" :file-list="model1.fileList" :custom-btn="true" :max-count="1"> | ||
| 103 | + <view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> | ||
| 104 | + <u-image width="304rpx" height="182rpx" src="/static/images/uploadID2.png"></u-image> | ||
| 105 | + </view> | ||
| 106 | + </u-upload> | ||
| 107 | + <text>点击上传证件国徽面</text> | ||
| 108 | + </view> | ||
| 109 | + </view> | ||
| 110 | + </view> | ||
| 111 | + <view class="add-list"> | ||
| 112 | + <view style="line-height: 60rpx;">上传示例</view> | ||
| 113 | + <view class="deom-box"> | ||
| 114 | + <view class="img-deom"> | ||
| 115 | + <u-image width="304rpx" height="182rpx" src="/static/images/front-icon.png"></u-image> | ||
| 116 | + <text>人脸示例图</text> | ||
| 117 | + </view> | ||
| 118 | + <view class="img-deom"> | ||
| 119 | + <u-image width="304rpx" height="182rpx" src="/static/images/back-icon.png"></u-image> | ||
| 120 | + <text>国徽面示例图</text> | ||
| 121 | + </view> | ||
| 122 | + </view> | ||
| 123 | + </view> | ||
| 124 | + <text style="display: inline-block; font-size: 24rpx; line-height: 30px; margin: 24rpx 30rpx 0;">请拍摄证件原件,保证照片拍摄清晰,取图完整,不反光。</text> | ||
| 125 | + <view class="add-list" labelPosition="left" :model="model1" :rules="rules" ref="uForm" :labelWidth="250"> | ||
| 126 | + <u-form-item label="是否为法人" prop="name" borderBottom> | ||
| 127 | + <u-radio-group v-model="model1.name"> | ||
| 128 | + <u-radio :name="1">是</u-radio> | ||
| 129 | + <u-radio :name="2">否</u-radio> | ||
| 130 | + </u-radio-group> | ||
| 131 | + </u-form-item> | ||
| 132 | + <u-form-item label="企业授权书" prop="name" borderBottom labelPosition="top"> | ||
| 133 | + <u-upload :active="active" :file-list="model1.fileList" ></u-upload> | ||
| 134 | + </u-form-item> | ||
| 135 | + </view> | ||
| 136 | + </u-form> | ||
| 137 | + </view> | ||
| 138 | + </view> | ||
| 139 | + <!-- 保存按钮 --> | ||
| 140 | + <view class="page-footer"> | ||
| 141 | + <u-button style="background-color: #DFE0E4; flex: 1; margin: 0 10px;" @click="toBefor" v-if="active != 0">上一步</u-button> | ||
| 142 | + <u-button type="success" style="flex: 1; margin: 0 10px;" @click="toNext" v-if="active != 2">下一步</u-button> | ||
| 143 | + <u-button type="success" style="flex: 1; margin: 0 10px;" @click="go" v-if="active == 2">提交申请</u-button> | ||
| 144 | + </view> | ||
| 145 | + </view> | ||
| 146 | +</template> | ||
| 147 | + | ||
| 148 | +<script> | ||
| 149 | + export default { | ||
| 150 | + data() { | ||
| 151 | + return { | ||
| 152 | + active: 2, | ||
| 153 | + numList: [{name: '意向申请'}, {name: '主体信息'}, {name: '经营者信息'}], | ||
| 154 | + model1: { | ||
| 155 | + name: '', | ||
| 156 | + type: '', | ||
| 157 | + typeShow: false, | ||
| 158 | + fileList: [], // 文件列表 | ||
| 159 | + }, | ||
| 160 | + rules: {}, | ||
| 161 | + // 类型 | ||
| 162 | + showType: false, | ||
| 163 | + activesType: [ | ||
| 164 | + {value: 1, label: '类型1'}, | ||
| 165 | + {value: 2, label: '类型2'}, | ||
| 166 | + ], | ||
| 167 | + // 上传文件 | ||
| 168 | + active: '', // 地址 | ||
| 169 | + | ||
| 170 | + }; | ||
| 171 | + }, | ||
| 172 | + onLoad(option) { | ||
| 173 | + // 检查用户是否登录 | ||
| 174 | + const isLogin = uni.getStorageSync('token') || false; | ||
| 175 | + if (!isLogin) { | ||
| 176 | + // 如果未登录,跳转到登录页面 | ||
| 177 | + uni.redirectTo({ | ||
| 178 | + url: '/pages/login/login' | ||
| 179 | + }); | ||
| 180 | + } | ||
| 181 | + }, | ||
| 182 | + methods:{ | ||
| 183 | + typeChange(e) { | ||
| 184 | + this.model1.type = e[0].label; | ||
| 185 | + }, | ||
| 186 | + go(){ | ||
| 187 | + uni.navigateTo({ | ||
| 188 | + url: '/pages/record/record' | ||
| 189 | + }) | ||
| 190 | + }, | ||
| 191 | + // 上一步 | ||
| 192 | + toBefor() { | ||
| 193 | + this.active = +this.active - 1; | ||
| 194 | + }, | ||
| 195 | + // 下一步 | ||
| 196 | + toNext() { | ||
| 197 | + this.active = +this.active + 1; | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | +</script> | ||
| 202 | + | ||
| 203 | +<style scoped lang="scss"> | ||
| 204 | + @import 'intentionApply.scss'; | ||
| 205 | +</style> |
pages/leaseAdd/leaseAdd.vue
| @@ -153,16 +153,16 @@ | @@ -153,16 +153,16 @@ | ||
| 153 | 153 | ||
| 154 | }; | 154 | }; |
| 155 | }, | 155 | }, |
| 156 | - onLoad() { | 156 | + onLoad(option) { |
| 157 | // 检查用户是否登录 | 157 | // 检查用户是否登录 |
| 158 | - const isLogin = uni.getStorageSync('token') || false; | 158 | + const isLogin = uni.getStorageSync('token') || false; |
| 159 | if (!isLogin) { | 159 | if (!isLogin) { |
| 160 | // 如果未登录,跳转到登录页面 | 160 | // 如果未登录,跳转到登录页面 |
| 161 | - uni.redirectTo({ | ||
| 162 | - url: '/pages/login/login' | ||
| 163 | - }); | 161 | + uni.redirectTo({ |
| 162 | + url: '/pages/login/login' | ||
| 163 | + }); | ||
| 164 | } | 164 | } |
| 165 | - }, | 165 | + }, |
| 166 | methods:{ | 166 | methods:{ |
| 167 | typeChange(e) { | 167 | typeChange(e) { |
| 168 | this.model1.type = e[0].label; | 168 | this.model1.type = e[0].label; |
pages/propertyPay/payDetail/payDetail.scss
0 → 100644
| 1 | +.page{ | ||
| 2 | + position: absolute; | ||
| 3 | + left: 0; | ||
| 4 | + top: 0; | ||
| 5 | + width: 100%; | ||
| 6 | + height: 100%; | ||
| 7 | + padding: 24rpx 24rpx 0; | ||
| 8 | +} | ||
| 9 | +.content { | ||
| 10 | + width: 100%; | ||
| 11 | + background-color: #fff; | ||
| 12 | + padding: 0 34rpx; | ||
| 13 | + border-radius: 16rpx; | ||
| 14 | + margin-bottom: 20rpx; | ||
| 15 | + .form-item { | ||
| 16 | + display: flex; | ||
| 17 | + align-items: center; | ||
| 18 | + justify-content: space-between; | ||
| 19 | + line-height: 50rpx; | ||
| 20 | + padding: 6rpx 0; | ||
| 21 | + .left { | ||
| 22 | + color: #808080; | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + :last-child { | ||
| 26 | + border-bottom: unset; | ||
| 27 | + } | ||
| 28 | + .list-info { | ||
| 29 | + width: 100%; | ||
| 30 | + display: flex; | ||
| 31 | + align-items: center; | ||
| 32 | + padding: 26rpx 0; | ||
| 33 | + border-bottom: #f6f6f6 solid 1rpx; | ||
| 34 | + .img { | ||
| 35 | + width: 80rpx; | ||
| 36 | + height: 80rpx; | ||
| 37 | + border-radius: 50%; | ||
| 38 | + overflow: hidden; | ||
| 39 | + image { | ||
| 40 | + width: 100%; | ||
| 41 | + height: 100%; | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + .info-items { | ||
| 45 | + width: calc(100% - 100rpx); | ||
| 46 | + margin-left: 20rpx; | ||
| 47 | + font-size: 24rpx; | ||
| 48 | + .info-item { | ||
| 49 | + width: 100%; | ||
| 50 | + display: flex; | ||
| 51 | + flex-direction: row; | ||
| 52 | + align-items: center; | ||
| 53 | + justify-content: space-between; | ||
| 54 | + // line-height: 50rpx; | ||
| 55 | + padding: 8rpx 10rpx; | ||
| 56 | + .price { | ||
| 57 | + color: #0FBB59; | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | +} |
pages/propertyPay/payDetail/payDetail.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="page"> | ||
| 3 | + <view class="content"> | ||
| 4 | + <view class="list-info" v-for="i in 5" :key="i"> | ||
| 5 | + <view class="img"> | ||
| 6 | + <image :src="$imgUrl('/img/2.jpg')"></image> | ||
| 7 | + </view> | ||
| 8 | + <view class="info-items"> | ||
| 9 | + <view class="info-item"> | ||
| 10 | + <view class="title">物业费</view> | ||
| 11 | + <view class="right"><text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />500.00</text></view> | ||
| 12 | + </view> | ||
| 13 | + <view class="info-item" style="color: #808080;"> | ||
| 14 | + <view class="left">周期:2022.02.22 - 2022.02.22</view> | ||
| 15 | + <view class="right">费率:100%</view> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | + <view class="content" style="padding: 8rpx 34rpx;"> | ||
| 21 | + <view class="form-item"> | ||
| 22 | + <view class="left">订单状态</view> | ||
| 23 | + <view class="right">支付成功</view> | ||
| 24 | + </view> | ||
| 25 | + <view class="form-item"> | ||
| 26 | + <view class="left">实缴费用</view> | ||
| 27 | + <view class="right">¥500.00</view> | ||
| 28 | + </view> | ||
| 29 | + <view class="form-item"> | ||
| 30 | + <view class="left">商户全称</view> | ||
| 31 | + <view class="right">大兴鸡排</view> | ||
| 32 | + </view> | ||
| 33 | + <view class="form-item"> | ||
| 34 | + <view class="left">门店号</view> | ||
| 35 | + <view class="right">A2121</view> | ||
| 36 | + </view> | ||
| 37 | + <view class="form-item"> | ||
| 38 | + <view class="left">(户主)付款人</view> | ||
| 39 | + <view class="right">张三</view> | ||
| 40 | + </view> | ||
| 41 | + <view class="form-item"> | ||
| 42 | + <view class="left">支付账号</view> | ||
| 43 | + <view class="right">13454546578</view> | ||
| 44 | + </view> | ||
| 45 | + <view class="form-item"> | ||
| 46 | + <view class="left">支付方式</view> | ||
| 47 | + <view class="right">微信</view> | ||
| 48 | + </view> | ||
| 49 | + | ||
| 50 | + <view class="form-item"> | ||
| 51 | + <view class="left">渠道</view> | ||
| 52 | + <view class="right">线上</view> | ||
| 53 | + </view> | ||
| 54 | + <view class="form-item"> | ||
| 55 | + <view class="left">支付开始时间</view> | ||
| 56 | + <view class="right">2022-02-22 14:00:00</view> | ||
| 57 | + </view> | ||
| 58 | + <view class="form-item"> | ||
| 59 | + <view class="left">支付完成时间</view> | ||
| 60 | + <view class="right">2022-02-22 14:00:00</view> | ||
| 61 | + </view> | ||
| 62 | + <view class="form-item"> | ||
| 63 | + <view class="left">支付订单号</view> | ||
| 64 | + <view class="right">jh5465465451</view> | ||
| 65 | + </view> | ||
| 66 | + <view class="form-item"> | ||
| 67 | + <view class="left">流水号</view> | ||
| 68 | + <view class="right">024684651</view> | ||
| 69 | + </view> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | +</template> | ||
| 73 | + | ||
| 74 | +<script> | ||
| 75 | + export default { | ||
| 76 | + data() { | ||
| 77 | + return { | ||
| 78 | + show: false, | ||
| 79 | + dataList: [ | ||
| 80 | + { | ||
| 81 | + children: [{}, {}] | ||
| 82 | + }, | ||
| 83 | + { | ||
| 84 | + children: [{}, {}] | ||
| 85 | + }, | ||
| 86 | + ] | ||
| 87 | + } | ||
| 88 | + }, | ||
| 89 | + methods: { | ||
| 90 | + toDetail() { | ||
| 91 | + uni.navigateTo({ | ||
| 92 | + url: '/pages/propertyPay/payDetail/payDetail' | ||
| 93 | + }) | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | +</script> | ||
| 98 | + | ||
| 99 | +<style scoped lang="scss"> | ||
| 100 | + @import 'payDetail.scss'; | ||
| 101 | +</style> | ||
| 0 | \ No newline at end of file | 102 | \ No newline at end of file |
pages/propertyPay/payRecord/payRecord.scss
0 → 100644
| 1 | +.page{ | ||
| 2 | + position: absolute; | ||
| 3 | + left: 0; | ||
| 4 | + top: 0; | ||
| 5 | + width: 100%; | ||
| 6 | + height: 100%; | ||
| 7 | + padding: 0 24rpx; | ||
| 8 | +} | ||
| 9 | +.title-top { | ||
| 10 | + display: flex; | ||
| 11 | + align-items: center; | ||
| 12 | + justify-content: space-between; | ||
| 13 | + margin: 40rpx 0 16rpx; | ||
| 14 | + .right { | ||
| 15 | + font-size: 32rpx; | ||
| 16 | + font-weight: 700; | ||
| 17 | + } | ||
| 18 | +} | ||
| 19 | +.record-list { | ||
| 20 | + width: 100%; | ||
| 21 | + .record-item { | ||
| 22 | + background-color: #fff; | ||
| 23 | + padding: 34rpx; | ||
| 24 | + border-radius: 14rpx; | ||
| 25 | + margin-bottom: 20rpx; | ||
| 26 | + .info-title { | ||
| 27 | + display: flex; | ||
| 28 | + flex-direction: row; | ||
| 29 | + align-items: center; | ||
| 30 | + justify-content: space-between; | ||
| 31 | + padding-bottom: 20rpx; | ||
| 32 | + border-bottom: #f6f6f6 solid 1rpx; | ||
| 33 | + .title { | ||
| 34 | + font-weight: 700; | ||
| 35 | + } | ||
| 36 | + .price { | ||
| 37 | + font-size: 32rpx; | ||
| 38 | + font-weight: 700; | ||
| 39 | + color: #0FBB59; | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + .info-items { | ||
| 43 | + border-bottom: #f6f6f6 solid 1rpx; | ||
| 44 | + margin-top: 16rpx; | ||
| 45 | + padding-bottom: 16rpx; | ||
| 46 | + .info-item { | ||
| 47 | + width: 100%; | ||
| 48 | + display: flex; | ||
| 49 | + flex-direction: row; | ||
| 50 | + align-items: center; | ||
| 51 | + justify-content: space-between; | ||
| 52 | + // line-height: 50rpx; | ||
| 53 | + padding: 8rpx 10rpx; | ||
| 54 | + .title { | ||
| 55 | + font-weight: 700; | ||
| 56 | + } | ||
| 57 | + .price { | ||
| 58 | + font-size: 28rpx; | ||
| 59 | + font-weight: 700; | ||
| 60 | + color: #0FBB59; | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + :last-child { | ||
| 65 | + border-bottom: unset; | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | +} | ||
| 0 | \ No newline at end of file | 69 | \ No newline at end of file |
pages/propertyPay/payRecord/payRecord.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="page"> | ||
| 3 | + <view class="title-top"> | ||
| 4 | + <div class="left"> | ||
| 5 | + <text @click="show = true">2024年<u-icon name="arrow-down"></u-icon></text> | ||
| 6 | + <u-picker v-model="show" mode="time" :params="{year: true}"></u-picker> | ||
| 7 | + </div> | ||
| 8 | + <div class="right"><text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />6451.00</text></div> | ||
| 9 | + </view> | ||
| 10 | + <view class="record-list"> | ||
| 11 | + <view class="record-item" v-for="(item, index) in dataList" :key="index" @click="toDetail"> | ||
| 12 | + <view class="info-title"> | ||
| 13 | + <view class="title">7月</view> | ||
| 14 | + <view class="right"><text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />6451.00</text></view> | ||
| 15 | + </view> | ||
| 16 | + <view class="info-items" v-for="(v, i) in item.children" :key="i"> | ||
| 17 | + <view class="info-item"> | ||
| 18 | + <view class="left title">支付订单编号</view> | ||
| 19 | + <view class="right"><text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />500.00</text></view> | ||
| 20 | + </view> | ||
| 21 | + <view class="info-item"> | ||
| 22 | + <view class="left">物业费、服务费、卫生费</view> | ||
| 23 | + <view class="right" style="color: #8A8A8A;">共3项</view> | ||
| 24 | + </view> | ||
| 25 | + <view class="info-item"> | ||
| 26 | + <view class="left" style="color: #0FBB59;">支付成功</view> | ||
| 27 | + <view class="right" style="color: #8A8A8A;">07.11 15:21</view> | ||
| 28 | + </view> | ||
| 29 | + </view> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | +</template> | ||
| 34 | + | ||
| 35 | +<script> | ||
| 36 | + export default { | ||
| 37 | + data() { | ||
| 38 | + return { | ||
| 39 | + show: false, | ||
| 40 | + dataList: [ | ||
| 41 | + { | ||
| 42 | + children: [{}, {}] | ||
| 43 | + }, | ||
| 44 | + { | ||
| 45 | + children: [{}, {}] | ||
| 46 | + }, | ||
| 47 | + ] | ||
| 48 | + } | ||
| 49 | + }, | ||
| 50 | + methods: { | ||
| 51 | + toDetail() { | ||
| 52 | + uni.navigateTo({ | ||
| 53 | + url: '/pages/propertyPay/payDetail/payDetail' | ||
| 54 | + }) | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | +</script> | ||
| 59 | + | ||
| 60 | +<style scoped lang="scss"> | ||
| 61 | + @import 'payRecord.scss'; | ||
| 62 | +</style> | ||
| 0 | \ No newline at end of file | 63 | \ No newline at end of file |
pages/propertyPay/propertyPayList/propertyPayList.scss
0 → 100644
| 1 | +.page{ | ||
| 2 | + position: absolute; | ||
| 3 | + left: 0; | ||
| 4 | + top: 0; | ||
| 5 | + width: 100%; | ||
| 6 | + height: 100%; | ||
| 7 | + padding: 0 20rpx; | ||
| 8 | +} | ||
| 9 | +.search-box { | ||
| 10 | + background-color: #FFFFFF; | ||
| 11 | + border-radius: 20rpx; | ||
| 12 | + padding: 20rpx; | ||
| 13 | + margin-top: 26rpx; | ||
| 14 | + .search-total { | ||
| 15 | + display: flex; | ||
| 16 | + flex-direction: row; | ||
| 17 | + align-items: flex-end; | ||
| 18 | + justify-content: space-between; | ||
| 19 | + font-size: 24rpx; | ||
| 20 | + padding: 0 10rpx; | ||
| 21 | + margin-top: 20rpx; | ||
| 22 | + .left { | ||
| 23 | + color: #757575; | ||
| 24 | + .price-total { | ||
| 25 | + color: #0FBB59; | ||
| 26 | + font-size: 50rpx; | ||
| 27 | + font-weight: 700; | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + .right { | ||
| 31 | + width: 30vw; | ||
| 32 | + text-align: right; | ||
| 33 | + } | ||
| 34 | + } | ||
| 35 | +} | ||
| 36 | +.price { | ||
| 37 | + color: #0FBB59; | ||
| 38 | + font-size: 32rpx; | ||
| 39 | + font-weight: 700; | ||
| 40 | +} | ||
| 41 | +/* 记录列表 */ | ||
| 42 | +.record-list{ | ||
| 43 | + margin-top: 20rpx; | ||
| 44 | + // margin: 0 20rpx; | ||
| 45 | + .record-list-box { | ||
| 46 | + background-color: #FFFFFF; | ||
| 47 | + border-radius: 20rpx; | ||
| 48 | + padding: 20rpx 30rpx; | ||
| 49 | + margin-bottom: 20rpx; | ||
| 50 | + width: 100%; | ||
| 51 | + .list { | ||
| 52 | + width: 100%; | ||
| 53 | + display: flex; | ||
| 54 | + padding: 20rpx 30rpx; | ||
| 55 | + border-bottom: #f6f6f6 solid 1rpx; | ||
| 56 | + align-items: center; | ||
| 57 | + .list-item { | ||
| 58 | + flex: 1; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + .list-info { | ||
| 62 | + display: flex; | ||
| 63 | + align-items: center; | ||
| 64 | + .img { | ||
| 65 | + width: 72rpx; | ||
| 66 | + height: 72rpx; | ||
| 67 | + border-radius: 50%; | ||
| 68 | + overflow: hidden; | ||
| 69 | + image { | ||
| 70 | + width: 100%; | ||
| 71 | + height: 100%; | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + .info-items { | ||
| 75 | + margin-left: 20rpx; | ||
| 76 | + .info-title { | ||
| 77 | + font-weight: 700; | ||
| 78 | + font-size: 28rpx; | ||
| 79 | + line-height: 40rpx; | ||
| 80 | + | ||
| 81 | + } | ||
| 82 | + .info-item { | ||
| 83 | + font-size: 24rpx; | ||
| 84 | + color: #808080; | ||
| 85 | + margin-top: 20rpx; | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | +} | ||
| 93 | +.page-footer{ | ||
| 94 | + position: fixed; | ||
| 95 | + left: 0; | ||
| 96 | + bottom: 0; | ||
| 97 | + width: 100%; | ||
| 98 | + height: 120rpx; | ||
| 99 | + background-color: #FFFFFF; | ||
| 100 | + padding: 0 20rpx; | ||
| 101 | + padding-bottom: constant(safe-area-inset-bottom); | ||
| 102 | + padding-bottom: env(safe-area-inset-bottom); | ||
| 103 | + z-index: 999; | ||
| 104 | + .footer-buy{ | ||
| 105 | + display: flex; | ||
| 106 | + align-items: center; | ||
| 107 | + justify-content: space-between; | ||
| 108 | + width: 100%; | ||
| 109 | + height: 100%; | ||
| 110 | + .cart-add{ | ||
| 111 | + display: flex; | ||
| 112 | + align-items: center; | ||
| 113 | + justify-content: center; | ||
| 114 | + width: 100%; | ||
| 115 | + height: 70rpx; | ||
| 116 | + background-color: #3f9b6a; | ||
| 117 | + text{ | ||
| 118 | + font-size: 28rpx; | ||
| 119 | + color: #FFFFFF; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | +} |
pages/propertyPay/propertyPayList/propertyPayList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="page"> | ||
| 3 | + <view class="search-box"> | ||
| 4 | + <view> | ||
| 5 | + <u-input v-model="value" type="select" border @click="show = true" style="background-color: #F7F7F7;"/> | ||
| 6 | + <u-select v-model="show" :list="list"></u-select> | ||
| 7 | + </view> | ||
| 8 | + <view class="search-total"> | ||
| 9 | + <view class="left"> | ||
| 10 | + <text class="price-total"><u-icon name="rmb" style="font-size: 24rpx;" />800.00</text> | ||
| 11 | + <text>(含代缴费)</text> | ||
| 12 | + </view> | ||
| 13 | + <div class="right" @click='toDetail'> | ||
| 14 | + <text>缴费记录<u-icon name="arrow-right" style="margin-left: 8rpx;"></u-icon></text> | ||
| 15 | + </div> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | + <!-- 记录列表 --> | ||
| 19 | + <view class="record-list"> | ||
| 20 | + <view class="record-list-box" v-for="(item,index) in recordList" :key="index"> | ||
| 21 | + <u-checkbox-group class="list-group" style="width: 100%;"> | ||
| 22 | + <view class="list"> | ||
| 23 | + <u-checkbox v-model="checked" shape="circle" :label-disabled="false" /> | ||
| 24 | + <view class="list-item"> | ||
| 25 | + <view class="list-info"> | ||
| 26 | + <view class="img"> | ||
| 27 | + <image :src="$imgUrl('/img/2.jpg')"></image> | ||
| 28 | + </view> | ||
| 29 | + <view class="info-items"> | ||
| 30 | + <view class="info-title">{{item.name}}:<text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />300.00</text></view> | ||
| 31 | + <view class="info-item"> | ||
| 32 | + <text>单价:¥15</text> | ||
| 33 | + <text>费率:100%</text> | ||
| 34 | + </view> | ||
| 35 | + </view> | ||
| 36 | + </view> | ||
| 37 | + </view> | ||
| 38 | + <view @click="recordList[index].showItem = !recordList[index].showItem"><u-icon name="arrow-right"></u-icon></view> | ||
| 39 | + </view> | ||
| 40 | + <view class="list" v-if="recordList[index].showItem"> | ||
| 41 | + <u-checkbox v-model="checked" shape="circle" :label-disabled="false" /> | ||
| 42 | + <view class=""> | ||
| 43 | + <view class="info-item">周期:2022.02.22 - 2022.02.22</view> | ||
| 44 | + <view class="info-item"> | ||
| 45 | + <text>数量:100m²</text> | ||
| 46 | + <text>门店号:A5646</text> | ||
| 47 | + </view> | ||
| 48 | + </view> | ||
| 49 | + <view class=""> | ||
| 50 | + <text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />300.00</text> | ||
| 51 | + </view> | ||
| 52 | + </view> | ||
| 53 | + </u-checkbox-group> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + <view style="height: 120rpx;"></view> | ||
| 57 | + <view class="page-footer"> | ||
| 58 | + <view class="footer-buy"> | ||
| 59 | + <u-radio shape="circle">全选</u-radio> | ||
| 60 | + <view class=""> | ||
| 61 | + 合计:<text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />300.00</text> | ||
| 62 | + </view> | ||
| 63 | + <u-button type="success" style="margin: 0 10rpx;">去支付</u-button> | ||
| 64 | + </view> | ||
| 65 | + </view> | ||
| 66 | + </view> | ||
| 67 | +</template> | ||
| 68 | + | ||
| 69 | +<script> | ||
| 70 | + export default { | ||
| 71 | + data() { | ||
| 72 | + return { | ||
| 73 | + show: false, | ||
| 74 | + value: '', | ||
| 75 | + list: [{ value: '1', label: '大兴鸡排(A2144' }, { value: '2', label: '湖' }], | ||
| 76 | + checked: [], | ||
| 77 | + recordList:[ | ||
| 78 | + { | ||
| 79 | + img: '', | ||
| 80 | + name: '物业费', | ||
| 81 | + price: 15, | ||
| 82 | + rate: '100%', | ||
| 83 | + chilren: [], | ||
| 84 | + showItem: false, | ||
| 85 | + }, | ||
| 86 | + { | ||
| 87 | + img: '', | ||
| 88 | + name: '卫生费', | ||
| 89 | + price: 15, | ||
| 90 | + rate: '100%', | ||
| 91 | + chilren: [], | ||
| 92 | + showItem: false, | ||
| 93 | + }, | ||
| 94 | + { | ||
| 95 | + img: '', | ||
| 96 | + name: '水费', | ||
| 97 | + price: 15, | ||
| 98 | + rate: '100%', | ||
| 99 | + chilren: [], | ||
| 100 | + showItem: false, | ||
| 101 | + }, | ||
| 102 | + { | ||
| 103 | + img: '', | ||
| 104 | + name: '电费', | ||
| 105 | + price: 15, | ||
| 106 | + rate: '100%', | ||
| 107 | + chilren: [], | ||
| 108 | + showItem: false, | ||
| 109 | + }, | ||
| 110 | + { | ||
| 111 | + img: '', | ||
| 112 | + name: '燃气费', | ||
| 113 | + price: 15, | ||
| 114 | + rate: '100%', | ||
| 115 | + chilren: [], | ||
| 116 | + showItem: false, | ||
| 117 | + }, | ||
| 118 | + ], | ||
| 119 | + }; | ||
| 120 | + }, | ||
| 121 | + methods: { | ||
| 122 | + recordXq(item){ | ||
| 123 | + const encodedItem = encodeURIComponent(JSON.stringify(item)); | ||
| 124 | + uni.navigateTo({ | ||
| 125 | + url: `/pages/accepting/accepting?item=${encodedItem}`, | ||
| 126 | + }) | ||
| 127 | + }, | ||
| 128 | + toDetail() { | ||
| 129 | + uni.navigateTo({ | ||
| 130 | + url: '/pages/propertyPay/payRecord/payRecord' | ||
| 131 | + }) | ||
| 132 | + }, | ||
| 133 | + contractdetail(){ | ||
| 134 | + // uni.navigateTo({ | ||
| 135 | + | ||
| 136 | + // }) | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | +</script> | ||
| 141 | + | ||
| 142 | +<style scoped lang="scss"> | ||
| 143 | + @import 'propertyPayList.scss'; | ||
| 144 | +</style> |
pages/questionnaire/questionnaire.vue
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | <image :src="$imgUrl('/img/2.jpg')"></image> | 22 | <image :src="$imgUrl('/img/2.jpg')"></image> |
| 23 | </view> | 23 | </view> |
| 24 | <view class="info"> | 24 | <view class="info"> |
| 25 | - <view class="title" >{{item.title}}</view> | 25 | + <view class="title" >这里有标题这里有标题这里有...</view> |
| 26 | <view class="info-item">填写时间:<span>{{item.tTime}}分钟</span></view> | 26 | <view class="info-item">填写时间:<span>{{item.tTime}}分钟</span></view> |
| 27 | <view class="info-item">截止时间:<span>{{item.jTime}}</span></view> | 27 | <view class="info-item">截止时间:<span>{{item.jTime}}</span></view> |
| 28 | <view class="info-item">问卷类型:<span>{{item.leiXing}}</span></view> | 28 | <view class="info-item">问卷类型:<span>{{item.leiXing}}</span></view> |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | </view> | 31 | </view> |
| 32 | <view style="height: 120rpx;"></view> | 32 | <view style="height: 120rpx;"></view> |
| 33 | <view class="page-footer"> | 33 | <view class="page-footer"> |
| 34 | - <u-button type="success" @click="toAdd">创建问卷</u-button> | 34 | + <u-button type="success" @click="createWen">创建问卷</u-button> |
| 35 | </view> | 35 | </view> |
| 36 | </view> | 36 | </view> |
| 37 | </template> | 37 | </template> |
| @@ -79,9 +79,6 @@ | @@ -79,9 +79,6 @@ | ||
| 79 | this.search(); | 79 | this.search(); |
| 80 | }, | 80 | }, |
| 81 | search() {}, | 81 | search() {}, |
| 82 | - toAdd() { | ||
| 83 | - | ||
| 84 | - }, | ||
| 85 | createWen(){ | 82 | createWen(){ |
| 86 | uni.navigateTo({ | 83 | uni.navigateTo({ |
| 87 | url: '/pages/createQuestionnaire/createQuestionnaire' | 84 | url: '/pages/createQuestionnaire/createQuestionnaire' |
pages/record/record.scss
| @@ -52,49 +52,22 @@ | @@ -52,49 +52,22 @@ | ||
| 52 | background-color: #FFFFFF; | 52 | background-color: #FFFFFF; |
| 53 | border-radius: 20rpx; | 53 | border-radius: 20rpx; |
| 54 | padding: 20rpx 30rpx; | 54 | padding: 20rpx 30rpx; |
| 55 | - margin-bottom: 20rpx; | ||
| 56 | - } | ||
| 57 | - .list-btn { | ||
| 58 | - display: inline-block; | ||
| 59 | - width: 100%; | ||
| 60 | - text-align: right; | ||
| 61 | - padding-bottom: 10rpx; | ||
| 62 | - .date-btn { | ||
| 63 | - background-color: #3f9b6a; | ||
| 64 | - color: #fff; | ||
| 65 | - font-size: 28rpx; | ||
| 66 | - font-weight: bold; | ||
| 67 | - padding: 10rpx 20rpx; | ||
| 68 | - border-radius: 10rpx; | ||
| 69 | - } | ||
| 70 | - } | ||
| 71 | - .list{ | ||
| 72 | - display: flex; | ||
| 73 | - align-items: center; | ||
| 74 | - justify-content: space-between; | ||
| 75 | - .title-date{ | ||
| 76 | - .date{ | ||
| 77 | - margin: 14rpx 0; | ||
| 78 | - text{ | ||
| 79 | - color:#3D3D3D; | ||
| 80 | - } | ||
| 81 | - .org{ | ||
| 82 | - color:#CDA33A; | ||
| 83 | - } | ||
| 84 | - .green{ | ||
| 85 | - color:#219129; | ||
| 86 | - } | ||
| 87 | - } | ||
| 88 | - } | ||
| 89 | - .integral{ | ||
| 90 | - text{ | 55 | + margin-bottom: 20rpx; |
| 56 | + .title { | ||
| 57 | + display: flex; | ||
| 58 | + .left { | ||
| 91 | font-size: 28rpx; | 59 | font-size: 28rpx; |
| 92 | - color: #3D3D3D; | 60 | + font-weight: 700; |
| 93 | } | 61 | } |
| 94 | - image { | ||
| 95 | - width: 22rpx; | ||
| 96 | - height: 22rpx; | 62 | + .right { |
| 63 | + width: 100rpx; | ||
| 64 | + text-align: right; | ||
| 65 | + color: #0FBB59; | ||
| 97 | } | 66 | } |
| 98 | } | 67 | } |
| 68 | + .info-item { | ||
| 69 | + line-height: 50rpx; | ||
| 70 | + color: #808080; | ||
| 71 | + } | ||
| 99 | } | 72 | } |
| 100 | } | 73 | } |
pages/record/record.vue
| @@ -10,25 +10,13 @@ | @@ -10,25 +10,13 @@ | ||
| 10 | <view class="record-list"> | 10 | <view class="record-list"> |
| 11 | <view class="record-list-box" v-for="(item,index) in recordList" :key="index" @click="recordXq(item)"> | 11 | <view class="record-list-box" v-for="(item,index) in recordList" :key="index" @click="recordXq(item)"> |
| 12 | <view class="list"> | 12 | <view class="list"> |
| 13 | - <view class="title-date"> | ||
| 14 | - <view class="date"> | ||
| 15 | - <text>都江堰广场8#-2,都江堰市柏条河北路下段 I 茶坊 I 广场</text> | 13 | + <view class="title"> |
| 14 | + <view class="left">都江堰广场8#-2,都江堰市柏条河北路下段 I 茶坊 I 广场</view> | ||
| 15 | + <view class="right"><u-icon name="arrow-rightward"></u-icon></view> | ||
| 16 | </view> | 16 | </view> |
| 17 | - <view class="date"> | ||
| 18 | - <text>承租人姓名:{{item.porName}}</text> | ||
| 19 | - </view> | ||
| 20 | - <view class="date"> | ||
| 21 | - <text>提交时间:{{item.tTime}}</text> | ||
| 22 | - </view> | ||
| 23 | - <view class="date"> | ||
| 24 | - 状态:<text :class="item.state == '受理中'?'org':'green'">{{item.state}}</text> | ||
| 25 | - </view> | ||
| 26 | - </view> | ||
| 27 | - <view class="integral"> | ||
| 28 | - <image :src="$imgUrl('/right2.png')"></image> | 17 | + <view class="info-item">申请时间:2022-02-22 14:00</view> |
| 18 | + <view class="info-item">状态:<span style="color: #0FBB59;">受理中</span></view> | ||
| 29 | </view> | 19 | </view> |
| 30 | - </view> | ||
| 31 | - | ||
| 32 | </view> | 20 | </view> |
| 33 | </view> | 21 | </view> |
| 34 | </view> | 22 | </view> |
| @@ -42,13 +30,13 @@ | @@ -42,13 +30,13 @@ | ||
| 42 | { | 30 | { |
| 43 | recordName:'这里有名称这里有名称', | 31 | recordName:'这里有名称这里有名称', |
| 44 | porName:'徐丽', | 32 | porName:'徐丽', |
| 45 | - tTime:'2024-10-8 11:04:20', | 33 | + tTime:'2022-02-22 12:00:00', |
| 46 | state:'受理中' | 34 | state:'受理中' |
| 47 | }, | 35 | }, |
| 48 | { | 36 | { |
| 49 | recordName:'这里有名称这里有名称', | 37 | recordName:'这里有名称这里有名称', |
| 50 | - porName:'王城', | ||
| 51 | - tTime:'2024-10-9 10:20:47', | 38 | + porName:'徐丽', |
| 39 | + tTime:'2022-02-22 12:00:00', | ||
| 52 | state:'已通过' | 40 | state:'已通过' |
| 53 | } | 41 | } |
| 54 | ] | 42 | ] |
pages/recordService/recordService.scss
| @@ -5,71 +5,33 @@ | @@ -5,71 +5,33 @@ | ||
| 5 | width: 100%; | 5 | width: 100%; |
| 6 | height: 100%; | 6 | height: 100%; |
| 7 | } | 7 | } |
| 8 | -/* 记录列表 */ | ||
| 9 | -.record-list{ | ||
| 10 | - margin: 20rpx; | ||
| 11 | - .record-list-box { | ||
| 12 | - background-color: #FFFFFF; | ||
| 13 | - border-radius: 20rpx; | ||
| 14 | - padding: 20rpx 30rpx; | ||
| 15 | - margin-bottom: 20rpx; | ||
| 16 | - } | ||
| 17 | - .list-btn { | ||
| 18 | - display: inline-block; | ||
| 19 | - width: 100%; | ||
| 20 | - text-align: right; | ||
| 21 | - padding-bottom: 10rpx; | ||
| 22 | - .date-btn { | ||
| 23 | - background-color: #3f9b6a; | ||
| 24 | - color: #fff; | ||
| 25 | - font-size: 28rpx; | ||
| 26 | - font-weight: bold; | ||
| 27 | - padding: 10rpx 20rpx; | ||
| 28 | - border-radius: 10rpx; | ||
| 29 | - } | ||
| 30 | - } | ||
| 31 | - .list{ | ||
| 32 | - display: flex; | ||
| 33 | - align-items: center; | ||
| 34 | - justify-content: space-between; | ||
| 35 | - .title-date{ | ||
| 36 | - .date{ | ||
| 37 | - margin: 14rpx 0; | ||
| 38 | - text{ | ||
| 39 | - color:#3D3D3D; | ||
| 40 | - } | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - .integral{ | ||
| 44 | - text{ | ||
| 45 | - font-size: 28rpx; | ||
| 46 | - color: #3D3D3D; | ||
| 47 | - } | ||
| 48 | - image { | ||
| 49 | - width: 22rpx; | ||
| 50 | - height: 22rpx; | ||
| 51 | - } | ||
| 52 | - } | ||
| 53 | - } | ||
| 54 | -} | ||
| 55 | .screen-list { | 8 | .screen-list { |
| 56 | display: flex; | 9 | display: flex; |
| 57 | align-items: center; | 10 | align-items: center; |
| 58 | width: 100%; | 11 | width: 100%; |
| 59 | - margin: 30rpx 25rpx; | 12 | + margin: 20rpx 20rpx; |
| 13 | + padding: 0 10rpx; | ||
| 14 | + .zidong{ | ||
| 15 | + width: 160rpx; | ||
| 16 | + background-color: #3F9B6A; | ||
| 17 | + color: #fff; | ||
| 18 | + padding: 10rpx; | ||
| 19 | + border-radius: 30rpx; | ||
| 20 | + font-size: 24rpx; | ||
| 21 | + text-align: center; | ||
| 22 | + } | ||
| 60 | .list { | 23 | .list { |
| 61 | display: flex; | 24 | display: flex; |
| 62 | - justify-content: space-between; | 25 | + justify-content: center; |
| 63 | align-items: center; | 26 | align-items: center; |
| 64 | - width: 75%; | 27 | + width: 30%; |
| 65 | height: 100%; | 28 | height: 100%; |
| 66 | background-color: #fff; | 29 | background-color: #fff; |
| 67 | - padding: 20rpx; | ||
| 68 | - border-radius: 10rpx; | ||
| 69 | - margin-left: 30rpx; | 30 | + padding: 10rpx 16rpx; |
| 31 | + border-radius: 18rpx; | ||
| 32 | + color: #0FBB59; | ||
| 70 | text { | 33 | text { |
| 71 | font-size: 26rpx; | 34 | font-size: 26rpx; |
| 72 | - color: #469e70; | ||
| 73 | } | 35 | } |
| 74 | image { | 36 | image { |
| 75 | width: 30rpx; | 37 | width: 30rpx; |
| @@ -77,4 +39,35 @@ | @@ -77,4 +39,35 @@ | ||
| 77 | margin-left: 10rpx; | 39 | margin-left: 10rpx; |
| 78 | } | 40 | } |
| 79 | } | 41 | } |
| 80 | - } | ||
| 81 | \ No newline at end of file | 42 | \ No newline at end of file |
| 43 | + .action { | ||
| 44 | + text { | ||
| 45 | + color: $base; | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | +/* 记录列表 */ | ||
| 50 | +.record-list{ | ||
| 51 | + margin: 0 20rpx; | ||
| 52 | + .record-list-box { | ||
| 53 | + background-color: #FFFFFF; | ||
| 54 | + border-radius: 20rpx; | ||
| 55 | + padding: 20rpx 30rpx; | ||
| 56 | + margin-bottom: 20rpx; | ||
| 57 | + .title { | ||
| 58 | + display: flex; | ||
| 59 | + .left { | ||
| 60 | + font-size: 28rpx; | ||
| 61 | + font-weight: 700; | ||
| 62 | + } | ||
| 63 | + .right { | ||
| 64 | + width: 100rpx; | ||
| 65 | + text-align: right; | ||
| 66 | + color: #0FBB59; | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + .info-item { | ||
| 70 | + line-height: 50rpx; | ||
| 71 | + color: #808080; | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | +} |
pages/recordService/recordService.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | <view class="screen-list"> | 3 | <view class="screen-list"> |
| 4 | - <view>记录查询</view> | ||
| 5 | <view class="list"> | 4 | <view class="list"> |
| 6 | - <text>报事报修</text> | ||
| 7 | - <image :src="$imgUrl('/down.png')"></image> | 5 | + <text>报事报修记录</text> |
| 6 | + <image :src="$imgUrl('/down.png')" ></image> | ||
| 8 | </view> | 7 | </view> |
| 9 | </view> | 8 | </view> |
| 10 | <!-- 记录列表 --> | 9 | <!-- 记录列表 --> |
| 11 | <view class="record-list"> | 10 | <view class="record-list"> |
| 12 | - <view class="record-list-box" v-for="(item,index) in 0" :key="index"> | 11 | + <view class="record-list-box" v-for="(item,index) in recordList" :key="index"> |
| 13 | <view class="list"> | 12 | <view class="list"> |
| 14 | - <view class="title-date"> | ||
| 15 | - <view class="date"> | ||
| 16 | - <text>设备名称:这里有名称这里有名称</text> | 13 | + <view class="title"> |
| 14 | + <view class="left">这里有设备名称这里有设备名称</view> | ||
| 15 | + <view class="right"><u-icon name="arrow-rightward"></u-icon></view> | ||
| 17 | </view> | 16 | </view> |
| 18 | - <view class="date"> | ||
| 19 | - <text>设备类型:这里有类型</text> | ||
| 20 | - </view> | ||
| 21 | - <view class="date"> | ||
| 22 | - <text>报修问题:这里有文字这里有文字这里有文字</text> | ||
| 23 | - </view> | ||
| 24 | - <view class="date"> | ||
| 25 | - <text>报修时间:2024-07-01 12:00:00</text> | ||
| 26 | - </view> | ||
| 27 | - </view> | ||
| 28 | - <view class="integral"> | ||
| 29 | - <image :src="$imgUrl('/right2.png')" ></image> | ||
| 30 | - </view> | ||
| 31 | - </view> | ||
| 32 | - <view class="list-btn"> | ||
| 33 | - <text class="date-btn">评价</text> | 17 | + <view class="info-item">申请时间:2022-02-22 14:00</view> |
| 18 | + <view class="info-item">状态:<span style="color: #0FBB59;">受理中</span></view> | ||
| 34 | </view> | 19 | </view> |
| 35 | </view> | 20 | </view> |
| 36 | </view> | 21 | </view> |
| @@ -41,13 +26,33 @@ | @@ -41,13 +26,33 @@ | ||
| 41 | export default { | 26 | export default { |
| 42 | data() { | 27 | data() { |
| 43 | return { | 28 | return { |
| 29 | + recordList:[ | ||
| 30 | + { | ||
| 31 | + recordName:'这里有名称这里有名称', | ||
| 32 | + porName:'徐丽', | ||
| 33 | + tTime:'2022-02-22 12:00:00', | ||
| 34 | + state:'受理中' | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | + recordName:'这里有名称这里有名称', | ||
| 38 | + porName:'徐丽', | ||
| 39 | + tTime:'2022-02-22 12:00:00', | ||
| 40 | + state:'已通过' | ||
| 41 | + } | ||
| 42 | + ] | ||
| 44 | }; | 43 | }; |
| 45 | }, | 44 | }, |
| 46 | methods: { | 45 | methods: { |
| 47 | - contractdetail(){ | 46 | + recordXq(item){ |
| 47 | + const encodedItem = encodeURIComponent(JSON.stringify(item)); | ||
| 48 | uni.navigateTo({ | 48 | uni.navigateTo({ |
| 49 | - url: '/pages/contractdetail/contractdetail', | ||
| 50 | - }) | 49 | + url: `/pages/accepting/accepting?item=${encodedItem}`, |
| 50 | + }) | ||
| 51 | + }, | ||
| 52 | + contractdetail(){ | ||
| 53 | + // uni.navigateTo({ | ||
| 54 | + | ||
| 55 | + // }) | ||
| 51 | } | 56 | } |
| 52 | } | 57 | } |
| 53 | } | 58 | } |
| @@ -55,4 +60,4 @@ | @@ -55,4 +60,4 @@ | ||
| 55 | 60 | ||
| 56 | <style scoped lang="scss"> | 61 | <style scoped lang="scss"> |
| 57 | @import 'recordService.scss'; | 62 | @import 'recordService.scss'; |
| 58 | -</style> | 63 | +</style> |
uniCloud-tcb/cloudfunctions/usp-test/index.js
0 → 100644
uniCloud-tcb/cloudfunctions/usp-test/package.json
0 → 100644
uni_modules/wn-calendar/components/wn-calendar/calendar.js
0 → 100644
| 1 | +/** | ||
| 2 | + * | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +function getDays(year, month, data, isLess) { | ||
| 6 | + if (!Array.isArray(data)) { | ||
| 7 | + data = [] | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + let today = new Date() | ||
| 11 | + | ||
| 12 | + let y, m | ||
| 13 | + if (typeof(year) === 'number' && year > 2000 && typeof(month) === 'number') { | ||
| 14 | + const d = new Date(year, month - 1) | ||
| 15 | + y = d.getFullYear() | ||
| 16 | + m = d.getMonth() | ||
| 17 | + } else { | ||
| 18 | + y = today.getFullYear() | ||
| 19 | + m = today.getMonth() | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + let st = new Date(y, m, 1).getDay(), | ||
| 23 | + ed = new Date(y, m + 1, 0).getDay(), | ||
| 24 | + len = new Date(y, m + 1, 0).getDate() | ||
| 25 | + | ||
| 26 | + let isfill = data.length > 0 | ||
| 27 | + let days = Array.from(new Array(len), (x, i) => { | ||
| 28 | + i = i + 1 | ||
| 29 | + const date = `${y}/${m+1}/${i}` | ||
| 30 | + x = null | ||
| 31 | + if (isfill) { | ||
| 32 | + x = data.find(item => item.date === date) | ||
| 33 | + } | ||
| 34 | + return { | ||
| 35 | + show: true, | ||
| 36 | + label: i, | ||
| 37 | + date, | ||
| 38 | + data: x | ||
| 39 | + } | ||
| 40 | + }) | ||
| 41 | + | ||
| 42 | + let prev = new Date(y, m - 1), | ||
| 43 | + prevDate = `${prev.getFullYear()}/${prev.getMonth()+1}`, | ||
| 44 | + prevLd = new Date(y, m, 0).getDate() | ||
| 45 | + let prevDays = Array.from(new Array(st), (x, i) => { | ||
| 46 | + i = prevLd - (st - 1 - i) | ||
| 47 | + return { | ||
| 48 | + show: false, | ||
| 49 | + label: isLess ? '' : i, | ||
| 50 | + date: `${prevDate}/${i}` | ||
| 51 | + } | ||
| 52 | + }) | ||
| 53 | + days = prevDays.concat(days) | ||
| 54 | + | ||
| 55 | + let next = new Date(y, m + 1), | ||
| 56 | + nextDate = `${next.getFullYear()}/${next.getMonth()+1}` | ||
| 57 | + let lened = (days.length <= 35 ? 7 : 0) + (6 - ed) | ||
| 58 | + if (isLess) { | ||
| 59 | + lened = 6 - ed | ||
| 60 | + } | ||
| 61 | + let nextDays = Array.from(new Array(lened), (x, i) => { | ||
| 62 | + i = i + 1 | ||
| 63 | + return { | ||
| 64 | + show: false, | ||
| 65 | + label: isLess ? '' : i, | ||
| 66 | + date: `${nextDate}/${i}` | ||
| 67 | + } | ||
| 68 | + }) | ||
| 69 | + days = days.concat(nextDays) | ||
| 70 | + | ||
| 71 | + days = days.concat(Array.from(new Array(42 - days.length), (x, i) => { | ||
| 72 | + return { | ||
| 73 | + show: false, | ||
| 74 | + label: '', | ||
| 75 | + date: `*${i}` | ||
| 76 | + } | ||
| 77 | + })) | ||
| 78 | + | ||
| 79 | + return { | ||
| 80 | + days, | ||
| 81 | + year: y, | ||
| 82 | + month: m | ||
| 83 | + } | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +function getEn (m) { | ||
| 87 | + const en = [ | ||
| 88 | + 'Jan', | ||
| 89 | + 'Feb', | ||
| 90 | + 'Mar', | ||
| 91 | + 'Apr', | ||
| 92 | + 'May', | ||
| 93 | + 'Jun', | ||
| 94 | + 'Jul', | ||
| 95 | + 'Aug', | ||
| 96 | + 'Sept', | ||
| 97 | + 'Oct', | ||
| 98 | + 'Nov', | ||
| 99 | + 'Dec', | ||
| 100 | + ] | ||
| 101 | + return en[m - 1] | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +const labels_en = [ | ||
| 105 | + 'Sun', | ||
| 106 | + 'Mon', | ||
| 107 | + 'Tues', | ||
| 108 | + 'Wed', | ||
| 109 | + 'Thur', | ||
| 110 | + 'Fri', | ||
| 111 | + 'Sat', | ||
| 112 | +] | ||
| 113 | + | ||
| 114 | +const labels_zh = [ | ||
| 115 | + '日', | ||
| 116 | + '一', | ||
| 117 | + '二', | ||
| 118 | + '三', | ||
| 119 | + '四', | ||
| 120 | + '五', | ||
| 121 | + '六', | ||
| 122 | +] | ||
| 123 | + | ||
| 124 | +export default { | ||
| 125 | + getDays, | ||
| 126 | + getEn, | ||
| 127 | + labels_en, | ||
| 128 | + labels_zh | ||
| 129 | +} | ||
| 0 | \ No newline at end of file | 130 | \ No newline at end of file |
uni_modules/wn-calendar/components/wn-calendar/wn-calendar.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="wn-calendar"> | ||
| 3 | + | ||
| 4 | + <view class="head"> | ||
| 5 | + <image @click="onChange('prev')" | ||
| 6 | + src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAY5JREFUaEPtmEtugzAQhsc3aW5SbhI2SSOVCJ+g6QmoQqWWbspRcpNyELArQojUVqmw52EswYaNH/PNP57xWEHkn4rcflgAQiu4KBC9AsXxYw2qa6CFRutdIw2ECqGirA4K4GkwWp1s26XSECiAl7KyPzxuobGdSSQhaAF6GmEIegBhCB6AS1xZMInOdifOg80KcBbDqlTvNzUXBDvAEFHwrLPtgQNCBIATQgxghIDW1JRpVhSAA0IcgLpqBwKgu3oEBKCp2mEBCKp2eICxardm5ZOdZgMwiOF+9ZgVQN9T5NkmcanY8wKw0OT77SpaAJ+L32wU8In/czVxkev32D8tpedivsaHB+jbT2VSTNMTTgEC4wMq4J4ub0VnAAXojA+gAK3xsgDK1vnjQ+qZqG5OEwmhqJt6TI6foharAtzGs54BCeN5AIgK1JTwwQMcqy9QcHfdTPhlGg/w+v4JVq3HpxLXZmSql/8bhzrE/cJF+Xbf/zEXMgwIGgCzOcXcBYDCi5g1FgUw3qOYG70C39PtD0Aq3TXKAAAAAElFTkSuQmCC" | ||
| 7 | + class="arrow left" mode="aspectFit"></image> | ||
| 8 | + <text class="t">{{headText}}</text> | ||
| 9 | + <image @click="onChange('next')" | ||
| 10 | + src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAY5JREFUaEPtmEtugzAQhsc3aW5SbhI2SSOVCJ+g6QmoQqWWbspRcpNyELArQojUVqmw52EswYaNH/PNP57xWEHkn4rcflgAQiu4KBC9AsXxYw2qa6CFRutdIw2ECqGirA4K4GkwWp1s26XSECiAl7KyPzxuobGdSSQhaAF6GmEIegBhCB6AS1xZMInOdifOg80KcBbDqlTvNzUXBDvAEFHwrLPtgQNCBIATQgxghIDW1JRpVhSAA0IcgLpqBwKgu3oEBKCp2mEBCKp2eICxardm5ZOdZgMwiOF+9ZgVQN9T5NkmcanY8wKw0OT77SpaAJ+L32wU8In/czVxkev32D8tpedivsaHB+jbT2VSTNMTTgEC4wMq4J4ub0VnAAXojA+gAK3xsgDK1vnjQ+qZqG5OEwmhqJt6TI6foharAtzGs54BCeN5AIgK1JTwwQMcqy9QcHfdTPhlGg/w+v4JVq3HpxLXZmSql/8bhzrE/cJF+Xbf/zEXMgwIGgCzOcXcBYDCi5g1FgUw3qOYG70C39PtD0Aq3TXKAAAAAElFTkSuQmCC" | ||
| 11 | + class="arrow" mode="aspectFit"></image> | ||
| 12 | + </view> | ||
| 13 | + | ||
| 14 | + <view class="labels"> | ||
| 15 | + <view class="label-item" v-for="(label) in labels" :key="label"> | ||
| 16 | + <text class="t">{{label}}</text> | ||
| 17 | + </view> | ||
| 18 | + </view> | ||
| 19 | + | ||
| 20 | + <view :class="['row', isBorder ? 'border' : '']" v-for="row in rows"> | ||
| 21 | + <view @click="onChoose(item)" :class="[ | ||
| 22 | + 'day-item', | ||
| 23 | + item.show ? 'show' : '', | ||
| 24 | + active === item.date ? 'active' : '' | ||
| 25 | + ]" v-for="(item, ind) in days.slice(row*7, (row+1)*7)" :key="item.date"> | ||
| 26 | + <text class="t">{{item.label}}</text> | ||
| 27 | + <text v-if="item.data && item.data.text" class="data" | ||
| 28 | + :style="`color: ${colors[item.data.type] || '#f3a73f'};`">{{item.data.text}}</text> | ||
| 29 | + </view> | ||
| 30 | + | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | +</template> | ||
| 34 | + | ||
| 35 | +<script> | ||
| 36 | + import calendar from './calendar' | ||
| 37 | + export default { | ||
| 38 | + name: "w-calendar", | ||
| 39 | + emits: ['choose', 'change'], | ||
| 40 | + props: { | ||
| 41 | + data: { | ||
| 42 | + type: Array, | ||
| 43 | + default () { | ||
| 44 | + return [] | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + colors: { | ||
| 48 | + type: Array, | ||
| 49 | + default () { | ||
| 50 | + return ['#2979ff', '#18bc37', '#f3a73f', '#e43d33', '#8f939c'] | ||
| 51 | + } | ||
| 52 | + }, | ||
| 53 | + format: { | ||
| 54 | + type: String, | ||
| 55 | + default: '' | ||
| 56 | + }, | ||
| 57 | + isLess: { | ||
| 58 | + type: Boolean, | ||
| 59 | + default: false | ||
| 60 | + }, | ||
| 61 | + isBorder: { | ||
| 62 | + type: Boolean, | ||
| 63 | + default: true | ||
| 64 | + }, | ||
| 65 | + isEn: { | ||
| 66 | + type: Boolean, | ||
| 67 | + default: false | ||
| 68 | + } | ||
| 69 | + }, | ||
| 70 | + computed: { | ||
| 71 | + headText() { | ||
| 72 | + if (this.format === '/') { | ||
| 73 | + return `${this.year}/${this.month}` | ||
| 74 | + } else { | ||
| 75 | + if (this.isEn) { | ||
| 76 | + return `${calendar.getEn(this.month)}, ${this.year}` | ||
| 77 | + } else { | ||
| 78 | + return `${this.year}年${this.month}月` | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + }, | ||
| 83 | + data() { | ||
| 84 | + return { | ||
| 85 | + labels: this.isEn ? calendar.labels_en : calendar.labels_zh, | ||
| 86 | + active: '', | ||
| 87 | + rows: [0, 1, 2, 3, 4, 5, 6], | ||
| 88 | + days: [], | ||
| 89 | + year: '', | ||
| 90 | + month: '', | ||
| 91 | + | ||
| 92 | + }; | ||
| 93 | + }, | ||
| 94 | + created() { | ||
| 95 | + this.refresh() | ||
| 96 | + }, | ||
| 97 | + methods: { | ||
| 98 | + refresh() { | ||
| 99 | + this.$nextTick(() => { | ||
| 100 | + const {days, year, month} = calendar.getDays(this.year, this.month, this.data, this.isLess) | ||
| 101 | + this.days = days | ||
| 102 | + this.year = year | ||
| 103 | + this.month = month + 1 | ||
| 104 | + }) | ||
| 105 | + }, | ||
| 106 | + onChange(type) { | ||
| 107 | + this.month = type === 'prev' ? (this.month - 1) : (this.month + 1) | ||
| 108 | + this.refresh() | ||
| 109 | + this.$nextTick(() => { | ||
| 110 | + this.$emit('change', { | ||
| 111 | + year: this.year, | ||
| 112 | + month: this.month | ||
| 113 | + }) | ||
| 114 | + }) | ||
| 115 | + }, | ||
| 116 | + onChoose(item) { | ||
| 117 | + if (!item.show) return; | ||
| 118 | + this.active = item.date | ||
| 119 | + this.$nextTick(() => { | ||
| 120 | + this.$emit('choose', { | ||
| 121 | + date: item.date, | ||
| 122 | + data: item.data | ||
| 123 | + }) | ||
| 124 | + }) | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + } | ||
| 128 | +</script> | ||
| 129 | + | ||
| 130 | +<style scoped> | ||
| 131 | + .arrow { | ||
| 132 | + /* #ifndef APP-NVUE */ | ||
| 133 | + box-sizing: border-box; | ||
| 134 | + /* #endif */ | ||
| 135 | + padding: 4px; | ||
| 136 | + width: 22px; | ||
| 137 | + height: 22px; | ||
| 138 | + background: #f7f7f7; | ||
| 139 | + border-radius: 22px; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + .arrow.left { | ||
| 143 | + transform: rotate(180deg); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + .wn-calendar { | ||
| 147 | + min-width: 294px; | ||
| 148 | + background: white; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + .head { | ||
| 152 | + /* #ifndef APP-NVUE */ | ||
| 153 | + display: flex; | ||
| 154 | + /* #endif */ | ||
| 155 | + flex-direction: row; | ||
| 156 | + justify-content: center; | ||
| 157 | + align-items: center; | ||
| 158 | + padding: 8px 0px; | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + .head .t { | ||
| 162 | + padding: 0 42px; | ||
| 163 | + font-size: 16px; | ||
| 164 | + line-height: 32px; | ||
| 165 | + color: #3a3a3a; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + .labels { | ||
| 169 | + /* #ifndef APP-NVUE */ | ||
| 170 | + box-sizing: border-box; | ||
| 171 | + display: flex; | ||
| 172 | + /* #endif */ | ||
| 173 | + flex-direction: row; | ||
| 174 | + height: 36px; | ||
| 175 | + align-items: center; | ||
| 176 | + background: #f7f7f7; | ||
| 177 | + border-top: 1px solid #f0f0f0; | ||
| 178 | + border-bottom: 1px solid #f0f0f0; | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + .label-item { | ||
| 182 | + min-width: 42px; | ||
| 183 | + flex: 1; | ||
| 184 | + /* #ifndef APP-NVUE */ | ||
| 185 | + display: flex; | ||
| 186 | + align-items: center; | ||
| 187 | + justify-content: center; | ||
| 188 | + /* #endif */ | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + .label-item .t { | ||
| 192 | + font-size: 14px; | ||
| 193 | + text-align: center; | ||
| 194 | + line-height: 14px; | ||
| 195 | + color: #3a3a3a; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + .row { | ||
| 199 | + /* #ifndef APP-NVUE */ | ||
| 200 | + box-sizing: border-box; | ||
| 201 | + display: flex; | ||
| 202 | + /* #endif */ | ||
| 203 | + flex-direction: row; | ||
| 204 | + border-bottom: 1px solid transparent; | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + .row.border { | ||
| 208 | + border-bottom: 1px solid #f0f0f0; | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + .day-item { | ||
| 212 | + /* #ifndef APP-NVUE */ | ||
| 213 | + box-sizing: border-box; | ||
| 214 | + display: flex; | ||
| 215 | + flex-direction: column; | ||
| 216 | + align-items: center; | ||
| 217 | + /* #endif */ | ||
| 218 | + flex: 1; | ||
| 219 | + justify-content: center; | ||
| 220 | + padding: 7px 0px; | ||
| 221 | + border-radius: 4px; | ||
| 222 | + height: 42px; | ||
| 223 | + min-width: 42px; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + .day-item.show {} | ||
| 227 | + | ||
| 228 | + .day-item.active { | ||
| 229 | + background: #ededed !important; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + .day-item.active .t { | ||
| 233 | + font-weight: bold !important; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + .day-item .t { | ||
| 237 | + font-size: 15px; | ||
| 238 | + line-height: 15px; | ||
| 239 | + text-align: center; | ||
| 240 | + color: #909399; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + .day-item.show .t { | ||
| 244 | + color: #3a3a3a; | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + .day-item .data { | ||
| 248 | + margin-top: 2px; | ||
| 249 | + font-size: 11px; | ||
| 250 | + line-height: 11px; | ||
| 251 | + text-align: center; | ||
| 252 | + /* #ifdef APP-NVUE */ | ||
| 253 | + text-overflow: clip; | ||
| 254 | + word-wrap: anywhere; | ||
| 255 | + /* #endif */ | ||
| 256 | + color: #3a3a3a; | ||
| 257 | + } | ||
| 258 | +</style> | ||
| 0 | \ No newline at end of file | 259 | \ No newline at end of file |
uni_modules/wn-calendar/package.json
0 → 100644