Commit ba260b3f99c3c0c80da3c59173f684880323c44c
1 parent
54c9be5642
Exists in
master
修改
Showing
5 changed files
with
42 additions
and
140 deletions
Show diff stats
src/components/SimpleAddress/SimpleAddress.vue
| 1 | <template> | 1 | <template> |
| 2 | <view | 2 | <view |
| 3 | class="simple-address" | 3 | class="simple-address" |
| 4 | v-if="showPopup" | 4 | v-if="showPopup" |
| 5 | @touchmove.stop.prevent="clear" | 5 | @touchmove.stop.prevent="clear" |
| 6 | > | 6 | > |
| 7 | <!-- 遮罩层 --> | 7 | <!-- 遮罩层 --> |
| 8 | <view | 8 | <view |
| 9 | class="simple-address-mask" | 9 | class="simple-address-mask" |
| 10 | @touchmove.stop.prevent="clear" | 10 | @touchmove.stop.prevent="clear" |
| 11 | v-if="maskClick" | 11 | v-if="maskClick" |
| 12 | :class="[ani + '-mask', animation ? 'mask-ani' : '']" | 12 | :class="[ani + '-mask', animation ? 'mask-ani' : '']" |
| 13 | :style="{ | 13 | :style="{ |
| 14 | 'background-color': maskBgColor | 14 | 'background-color': maskBgColor |
| 15 | }" | 15 | }" |
| 16 | @tap="hideMask(true)" | 16 | @tap="hideMask(true)" |
| 17 | ></view> | 17 | ></view> |
| 18 | 18 | ||
| 19 | <view | 19 | <view |
| 20 | class="simple-address-content simple-address--fixed" | 20 | class="simple-address-content simple-address--fixed" |
| 21 | :class="[type, ani + '-content', animation ? 'content-ani' : '']" | 21 | :class="[type, ani + '-content', animation ? 'content-ani' : '']" |
| 22 | > | 22 | > |
| 23 | <view class="simple-address__header"> | 23 | <view class="simple-address__header"> |
| 24 | <view | 24 | <view |
| 25 | class="simple-address__header-btn-box" | 25 | class="simple-address__header-btn-box" |
| 26 | @click="pickerCancel" | 26 | @click="pickerCancel" |
| 27 | > | 27 | > |
| 28 | <text | 28 | <text |
| 29 | class="simple-address__header-text" | 29 | class="simple-address__header-text" |
| 30 | :style="{ color: cancelColor, fontSize: btnFontSize }" | 30 | :style="{ color: cancelColor, fontSize: btnFontSize }" |
| 31 | >取消</text> | 31 | >取消</text> |
| 32 | </view> | 32 | </view> |
| 33 | <view | 33 | <view |
| 34 | class="simple-address__header-btn-box" | 34 | class="simple-address__header-btn-box" |
| 35 | @click="pickerConfirm" | 35 | @click="pickerConfirm" |
| 36 | > | 36 | > |
| 37 | <text | 37 | <text |
| 38 | class="simple-address__header-text" | 38 | class="simple-address__header-text" |
| 39 | :style="{ color: confirmColor || themeColor, fontSize: btnFontSize }" | 39 | :style="{ color: confirmColor || themeColor, fontSize: btnFontSize }" |
| 40 | >确定</text> | 40 | >确定</text> |
| 41 | </view> | 41 | </view> |
| 42 | </view> | 42 | </view> |
| 43 | <view class="simple-address__box"> | 43 | <view class="simple-address__box"> |
| 44 | <picker-view | 44 | <picker-view |
| 45 | indicator-style="height: 70rpx;" | 45 | indicator-style="height: 70rpx;" |
| 46 | class="simple-address-view" | 46 | class="simple-address-view" |
| 47 | :value="pickerValue" | 47 | :value="pickerValue" |
| 48 | @change="pickerChange" | 48 | @change="pickerChange" |
| 49 | > | 49 | > |
| 50 | <picker-view-column> | 50 | <picker-view-column> |
| 51 | <!-- #ifndef APP-NVUE --> | 51 | <!-- #ifndef APP-NVUE --> |
| 52 | <view | 52 | <view |
| 53 | class="picker-item" | 53 | class="picker-item" |
| 54 | :style="{ fontSize: fontSize }" | 54 | :style="{ fontSize: fontSize }" |
| 55 | v-for="(item, index) in provinceDataList" | 55 | v-for="(item, index) in provinceDataList" |
| 56 | :key="index" | 56 | :key="index" |
| 57 | >{{ item.label }}</view> | 57 | >{{ item.label }}</view> |
| 58 | <!-- #endif --> | 58 | <!-- #endif --> |
| 59 | <!-- #ifdef APP-NVUE --> | 59 | <!-- #ifdef APP-NVUE --> |
| 60 | <text | 60 | <text |
| 61 | class="picker-item" | 61 | class="picker-item" |
| 62 | :style="{ fontSize: fontSize }" | 62 | :style="{ fontSize: fontSize }" |
| 63 | v-for="(item, index) in provinceDataList" | 63 | v-for="(item, index) in provinceDataList" |
| 64 | :key="index" | 64 | :key="index" |
| 65 | >{{ item.label }}</text> | 65 | >{{ item.label }}</text> |
| 66 | <!-- #endif --> | 66 | <!-- #endif --> |
| 67 | </picker-view-column> | 67 | </picker-view-column> |
| 68 | <picker-view-column> | 68 | <picker-view-column> |
| 69 | <!-- #ifndef APP-NVUE --> | 69 | <!-- #ifndef APP-NVUE --> |
| 70 | <view | 70 | <view |
| 71 | class="picker-item" | 71 | class="picker-item" |
| 72 | :style="{ fontSize: fontSize }" | 72 | :style="{ fontSize: fontSize }" |
| 73 | v-for="(item, index) in cityDataList" | 73 | v-for="(item, index) in cityDataList" |
| 74 | :key="index" | 74 | :key="index" |
| 75 | >{{ item.label }}</view> | 75 | >{{ item.label }}</view> |
| 76 | <!-- #endif --> | 76 | <!-- #endif --> |
| 77 | <!-- #ifdef APP-NVUE --> | 77 | <!-- #ifdef APP-NVUE --> |
| 78 | <text | 78 | <text |
| 79 | class="picker-item" | 79 | class="picker-item" |
| 80 | :style="{ fontSize: fontSize }" | 80 | :style="{ fontSize: fontSize }" |
| 81 | v-for="(item, index) in cityDataList" | 81 | v-for="(item, index) in cityDataList" |
| 82 | :key="index" | 82 | :key="index" |
| 83 | >{{ item.label }}</text> | 83 | >{{ item.label }}</text> |
| 84 | <!-- #endif --> | 84 | <!-- #endif --> |
| 85 | </picker-view-column> | 85 | </picker-view-column> |
| 86 | <picker-view-column> | 86 | <picker-view-column> |
| 87 | <!-- #ifndef APP-NVUE --> | 87 | <!-- #ifndef APP-NVUE --> |
| 88 | <view | 88 | <view |
| 89 | class="picker-item" | 89 | class="picker-item" |
| 90 | :style="{ fontSize: fontSize }" | 90 | :style="{ fontSize: fontSize }" |
| 91 | v-for="(item, index) in areaDataList" | 91 | v-for="(item, index) in areaDataList" |
| 92 | :key="index" | 92 | :key="index" |
| 93 | >{{ item.label }}</view> | 93 | >{{ item.label }}</view> |
| 94 | <!-- #endif --> | 94 | <!-- #endif --> |
| 95 | <!-- #ifdef APP-NVUE --> | 95 | <!-- #ifdef APP-NVUE --> |
| 96 | <text | 96 | <text |
| 97 | class="picker-item" | 97 | class="picker-item" |
| 98 | :style="{ fontSize: fontSize }" | 98 | :style="{ fontSize: fontSize }" |
| 99 | v-for="(item, index) in areaDataList" | 99 | v-for="(item, index) in areaDataList" |
| 100 | :key="index" | 100 | :key="index" |
| 101 | >{{ item.label }}</text> | 101 | >{{ item.label }}</text> |
| 102 | <!-- #endif --> | 102 | <!-- #endif --> |
| 103 | </picker-view-column> | 103 | </picker-view-column> |
| 104 | </picker-view> | 104 | </picker-view> |
| 105 | </view> | 105 | </view> |
| 106 | </view> | 106 | </view> |
| 107 | </view> | 107 | </view> |
| 108 | </template> | 108 | </template> |
| 109 | 109 | ||
| 110 | <script> | 110 | <script> |
| 111 | /** | 111 | /** |
| 112 | * Simple-addres 地址联动组件 | 112 | * Simple-addres 地址联动组件 |
| 113 | * @description 三级地址联动,支持(app)nvue、小程序、H5 | 113 | * @description 三级地址联动,支持(app)nvue、小程序、H5 |
| 114 | * @tutorial https://ext.dcloud.net.cn/plugin?id=1084 | 114 | * @tutorial https://ext.dcloud.net.cn/plugin?id=1084 |
| 115 | * @property {String} animation 是否开启动画 | 115 | * @property {String} animation 是否开启动画 |
| 116 | * @property {String} type = [bottom] 弹出层类型,暂时只支持底部弹出 | 116 | * @property {String} type = [bottom] 弹出层类型,暂时只支持底部弹出 |
| 117 | * @property {Boolean} maskClick = [true | false] 是否允许点击遮罩层关闭 | 117 | * @property {Boolean} maskClick = [true | false] 是否允许点击遮罩层关闭 |
| 118 | * @property {Boolean} show = [true | false] 显示或隐藏地址组件 | 118 | * @property {Boolean} show = [true | false] 显示或隐藏地址组件 |
| 119 | * @property {String} maskBgColor 遮罩层背景颜色 | 119 | * @property {String} maskBgColor 遮罩层背景颜色 |
| 120 | * @property {String} cancelColor 取消按钮颜色,默认为:#1aad19 | 120 | * @property {String} cancelColor 取消按钮颜色,默认为:#1aad19 |
| 121 | * @property {String} confirmColor 确认按钮颜色,默认为:themeColor | 121 | * @property {String} confirmColor 确认按钮颜色,默认为:themeColor |
| 122 | * @property {String} themeColor 主题颜色,后续会废弃该配置,建议使用`cancelColor`或`confirmColor` | 122 | * @property {String} themeColor 主题颜色,后续会废弃该配置,建议使用`cancelColor`或`confirmColor` |
| 123 | * @property {String} btnFontSize 取消、确认按钮字体大小,默认为`uni.scss里的 $uni-font-size-base ` | 123 | * @property {String} btnFontSize 取消、确认按钮字体大小,默认为`uni.scss里的 $uni-font-size-base ` |
| 124 | * @property {String} fontSize picker-item字体大小,默认为:28rpx | 124 | * @property {String} fontSize picker-item字体大小,默认为:28rpx |
| 125 | * @property {Array} pickerValueDefault 默认值,可以通过function queryIndex 获取 | 125 | * @property {Array} pickerValueDefault 默认值,可以通过function queryIndex 获取 |
| 126 | * @property {Function} queryIndex 根据自定义信息返回对应的index | 126 | * @property {Function} queryIndex 根据自定义信息返回对应的index |
| 127 | * @property {Function} open 打开 | 127 | * @property {Function} open 打开 |
| 128 | * @example <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor='#007AFF'></simple-address> | 128 | * @example <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor='#007AFF'></simple-address> |
| 129 | */ | 129 | */ |
| 130 | 130 | ||
| 131 | import provinceData from './cityData/province.js' | 131 | import provinceData from './cityData/province.js' |
| 132 | import cityData from './cityData/city.js' | 132 | import cityData from './cityData/city.js' |
| 133 | import areaData from './cityData/area.js' | 133 | import areaData from './cityData/area.js' |
| 134 | export default { | 134 | export default { |
| 135 | name: 'simpleAddress', | 135 | name: 'simpleAddress', |
| 136 | props: { | 136 | props: { |
| 137 | mode: { | 137 | mode: { |
| 138 | // 地址类型 | 138 | // 地址类型 |
| 139 | // default 则代表老版本根据index索引获取数据 | 139 | // default 则代表老版本根据index索引获取数据 |
| 140 | // | 140 | // |
| 141 | type: String, | 141 | type: String, |
| 142 | default: 'default' | 142 | default: 'default' |
| 143 | }, | 143 | }, |
| 144 | // 开启动画 | 144 | // 开启动画 |
| 145 | animation: { | 145 | animation: { |
| 146 | type: Boolean, | 146 | type: Boolean, |
| 147 | default: true | 147 | default: true |
| 148 | }, | 148 | }, |
| 149 | /* 弹出层类型,可选值; | 149 | /* 弹出层类型,可选值; |
| 150 | *bottom:底部弹出层 | 150 | *bottom:底部弹出层 |
| 151 | */ | 151 | */ |
| 152 | type: { | 152 | type: { |
| 153 | type: String, | 153 | type: String, |
| 154 | default: 'bottom' | 154 | default: 'bottom' |
| 155 | }, | 155 | }, |
| 156 | // maskClick | 156 | // maskClick |
| 157 | maskClick: { | 157 | maskClick: { |
| 158 | type: Boolean, | 158 | type: Boolean, |
| 159 | default: true | 159 | default: true |
| 160 | }, | 160 | }, |
| 161 | show: { | 161 | show: { |
| 162 | type: Boolean, | 162 | type: Boolean, |
| 163 | default: true | 163 | default: true |
| 164 | }, | 164 | }, |
| 165 | maskBgColor: { | 165 | maskBgColor: { |
| 166 | type: String, | 166 | type: String, |
| 167 | default: 'rgba(0, 0, 0, 0.4)' // 背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss | 167 | default: 'rgba(0, 0, 0, 0.4)' // 背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss |
| 168 | }, | 168 | }, |
| 169 | themeColor: { | 169 | themeColor: { |
| 170 | type: String, | 170 | type: String, |
| 171 | default: '' // 确认按钮颜色(向下兼容) | 171 | default: '' // 确认按钮颜色(向下兼容) |
| 172 | }, | 172 | }, |
| 173 | cancelColor: { | 173 | cancelColor: { |
| 174 | type: String, | 174 | type: String, |
| 175 | default: '' // 取消按钮颜色 | 175 | default: '' // 取消按钮颜色 |
| 176 | }, | 176 | }, |
| 177 | confirmColor: { | 177 | confirmColor: { |
| 178 | type: String, | 178 | type: String, |
| 179 | default: '' // 确认按钮颜色 | 179 | default: '' // 确认按钮颜色 |
| 180 | }, | 180 | }, |
| 181 | fontSize: { | 181 | fontSize: { |
| 182 | type: String, | 182 | type: String, |
| 183 | default: '28rpx' // picker-item字体大小 | 183 | default: '28rpx' // picker-item字体大小 |
| 184 | }, | 184 | }, |
| 185 | btnFontSize: { | 185 | btnFontSize: { |
| 186 | type: String, | 186 | type: String, |
| 187 | default: '' // 按钮的字体大小 | 187 | default: '' // 按钮的字体大小 |
| 188 | }, | 188 | }, |
| 189 | /* 默认值 */ | 189 | /* 默认值 */ |
| 190 | pickerValueDefault: { | 190 | pickerValueDefault: { |
| 191 | type: Array, | 191 | type: Array, |
| 192 | default () { | 192 | default () { |
| 193 | return [0, 0, 0] | 193 | return [0, 0, 0] |
| 194 | } | 194 | } |
| 195 | } | 195 | } |
| 196 | }, | 196 | }, |
| 197 | data () { | 197 | data () { |
| 198 | return { | 198 | return { |
| 199 | ani: '', | 199 | ani: '', |
| 200 | showPopup: false, | 200 | showPopup: false, |
| 201 | pickerValue: [0, 0, 0], | 201 | pickerValue: [0, 0, 0], |
| 202 | provinceDataList: [], | 202 | provinceDataList: [], |
| 203 | cityDataList: [], | 203 | cityDataList: [], |
| 204 | areaDataList: [] | 204 | areaDataList: [] |
| 205 | } | 205 | } |
| 206 | }, | 206 | }, |
| 207 | watch: { | 207 | watch: { |
| 208 | show (newValue) { | 208 | show (newValue) { |
| 209 | if (newValue) { | 209 | if (newValue) { |
| 210 | this.open() | 210 | this.open() |
| 211 | } else { | 211 | } else { |
| 212 | this.close() | 212 | this.close() |
| 213 | } | 213 | } |
| 214 | }, | 214 | }, |
| 215 | pickerValueDefault () { | 215 | pickerValueDefault () { |
| 216 | this.init() | 216 | this.init() |
| 217 | } | 217 | } |
| 218 | }, | 218 | }, |
| 219 | created () { | 219 | created () { |
| 220 | this.init() | 220 | this.init() |
| 221 | }, | 221 | }, |
| 222 | methods: { | 222 | methods: { |
| 223 | init () { | 223 | init () { |
| 224 | console.log(this.pickerValueDefault) | ||
| 224 | this.handPickValueDefault() // 对 pickerValueDefault 做兼容处理 | 225 | this.handPickValueDefault() // 对 pickerValueDefault 做兼容处理 |
| 225 | this.provinceDataList = provinceData | 226 | this.provinceDataList = provinceData |
| 226 | this.cityDataList = cityData[this.pickerValueDefault[0]] | 227 | this.cityDataList = cityData[this.pickerValueDefault[0]] |
| 227 | this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]] | 228 | this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]] |
| 228 | this.pickerValue = this.pickerValueDefault | 229 | this.pickerValue = this.pickerValueDefault |
| 229 | }, | 230 | }, |
| 230 | handPickValueDefault () { | 231 | handPickValueDefault () { |
| 231 | if (this.pickerValueDefault !== [0, 0, 0]) { | 232 | if (this.pickerValueDefault !== [0, 0, 0]) { |
| 232 | if (this.pickerValueDefault[0] > provinceData.length - 1) { | 233 | if (this.pickerValueDefault[0] > provinceData.length - 1) { |
| 233 | this.pickerValueDefault[0] = provinceData.length - 1 | 234 | this.pickerValueDefault[0] = provinceData.length - 1 |
| 234 | } | 235 | } |
| 235 | if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) { | 236 | if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) { |
| 236 | this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1 | 237 | this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1 |
| 237 | } | 238 | } |
| 238 | if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) { | 239 | if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) { |
| 239 | this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1 | 240 | this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1 |
| 240 | } | 241 | } |
| 241 | } | 242 | } |
| 242 | }, | 243 | }, |
| 243 | pickerChange (e) { | 244 | pickerChange (e) { |
| 244 | const changePickerValue = e.detail.value | 245 | const changePickerValue = e.detail.value |
| 245 | if (this.pickerValue[0] !== changePickerValue[0]) { | 246 | if (this.pickerValue[0] !== changePickerValue[0]) { |
| 246 | // 第一级发生滚动 | 247 | // 第一级发生滚动 |
| 247 | this.cityDataList = cityData[changePickerValue[0]] | 248 | this.cityDataList = cityData[changePickerValue[0]] |
| 248 | this.areaDataList = areaData[changePickerValue[0]][0] | 249 | this.areaDataList = areaData[changePickerValue[0]][0] |
| 249 | changePickerValue[1] = 0 | 250 | changePickerValue[1] = 0 |
| 250 | changePickerValue[2] = 0 | 251 | changePickerValue[2] = 0 |
| 251 | } else if (this.pickerValue[1] !== changePickerValue[1]) { | 252 | } else if (this.pickerValue[1] !== changePickerValue[1]) { |
| 252 | // 第二级滚动 | 253 | // 第二级滚动 |
| 253 | this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]] | 254 | this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]] |
| 254 | changePickerValue[2] = 0 | 255 | changePickerValue[2] = 0 |
| 255 | } | 256 | } |
| 256 | this.pickerValue = changePickerValue | 257 | this.pickerValue = changePickerValue |
| 257 | this._$emit('onChange') | 258 | this._$emit('onChange') |
| 258 | }, | 259 | }, |
| 259 | _$emit (emitName) { | 260 | _$emit (emitName) { |
| 260 | const pickObj = { | 261 | const pickObj = { |
| 261 | label: this._getLabel(), | 262 | label: this._getLabel(), |
| 262 | value: this.pickerValue, | 263 | value: this.pickerValue, |
| 263 | cityCode: this._getCityCode(), | 264 | cityCode: this._getCityCode(), |
| 264 | areaCode: this._getAreaCode(), | 265 | areaCode: this._getAreaCode(), |
| 265 | provinceCode: this._getProvinceCode(), | 266 | provinceCode: this._getProvinceCode(), |
| 266 | labelArr: this._getLabel().split('-') | 267 | labelArr: this._getLabel().split('-') |
| 267 | } | 268 | } |
| 268 | this.$emit(emitName, pickObj) | 269 | this.$emit(emitName, pickObj) |
| 269 | }, | 270 | }, |
| 270 | _getLabel () { | 271 | _getLabel () { |
| 271 | const pcikerLabel = this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label | 272 | const pcikerLabel = this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label |
| 272 | return pcikerLabel | 273 | return pcikerLabel |
| 273 | }, | 274 | }, |
| 274 | _getCityCode () { | 275 | _getCityCode () { |
| 275 | return this.cityDataList[this.pickerValue[1]].value | 276 | return this.cityDataList[this.pickerValue[1]].value |
| 276 | }, | 277 | }, |
| 277 | _getProvinceCode () { | 278 | _getProvinceCode () { |
| 278 | return this.provinceDataList[this.pickerValue[0]].value | 279 | return this.provinceDataList[this.pickerValue[0]].value |
| 279 | }, | 280 | }, |
| 280 | _getAreaCode () { | 281 | _getAreaCode () { |
| 281 | return this.areaDataList[this.pickerValue[2]].value | 282 | return this.areaDataList[this.pickerValue[2]].value |
| 282 | }, | 283 | }, |
| 283 | queryIndex (params = [], type = 'value') { | 284 | queryIndex (params = [], type = 'value') { |
| 284 | // params = [ 11 ,1101,110101 ]; | 285 | // params = [ 11 ,1101,110101 ]; |
| 285 | // 1.获取省份的index | 286 | // 1.获取省份的index |
| 286 | const provinceIndex = provinceData.findIndex(res => res[type] === params[0]) | 287 | const provinceIndex = provinceData.findIndex(res => res[type] === params[0]) |
| 287 | const cityIndex = cityData[provinceIndex].findIndex(res => res[type] === params[1]) | 288 | const cityIndex = cityData[provinceIndex].findIndex(res => res[type] === params[1]) |
| 288 | const areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] === params[2]) | 289 | const areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] === params[2]) |
| 289 | return { | 290 | return { |
| 290 | index: [provinceIndex, cityIndex, areaIndex], | 291 | index: [provinceIndex, cityIndex, areaIndex], |
| 291 | data: { | 292 | data: { |
| 292 | province: provinceData[provinceIndex], | 293 | province: provinceData[provinceIndex], |
| 293 | city: cityData[provinceIndex][cityIndex], | 294 | city: cityData[provinceIndex][cityIndex], |
| 294 | area: areaData[provinceIndex][cityIndex][areaIndex] | 295 | area: areaData[provinceIndex][cityIndex][areaIndex] |
| 295 | } | 296 | } |
| 296 | } | 297 | } |
| 297 | }, | 298 | }, |
| 298 | clear () {}, | 299 | clear () {}, |
| 299 | hideMask () { | 300 | hideMask () { |
| 300 | this._$emit('onCancel') | 301 | this._$emit('onCancel') |
| 301 | this.close() | 302 | this.close() |
| 302 | }, | 303 | }, |
| 303 | pickerCancel () { | 304 | pickerCancel () { |
| 304 | this._$emit('onCancel') | 305 | this._$emit('onCancel') |
| 305 | this.close() | 306 | this.close() |
| 306 | }, | 307 | }, |
| 307 | pickerConfirm () { | 308 | pickerConfirm () { |
| 308 | this._$emit('onConfirm') | 309 | this._$emit('onConfirm') |
| 309 | this.close() | 310 | this.close() |
| 310 | }, | 311 | }, |
| 311 | open () { | 312 | open () { |
| 312 | this.showPopup = true | 313 | this.showPopup = true |
| 313 | this.$nextTick(() => { | 314 | this.$nextTick(() => { |
| 314 | setTimeout(() => { | 315 | setTimeout(() => { |
| 315 | this.ani = 'simple-' + this.type | 316 | this.ani = 'simple-' + this.type |
| 316 | }, 100) | 317 | }, 100) |
| 317 | }) | 318 | }) |
| 318 | }, | 319 | }, |
| 319 | close (type) { | 320 | close (type) { |
| 320 | if (!this.maskClick && type) return | 321 | if (!this.maskClick && type) return |
| 321 | this.ani = '' | 322 | this.ani = '' |
| 322 | this.$nextTick(() => { | 323 | this.$nextTick(() => { |
| 323 | setTimeout(() => { | 324 | setTimeout(() => { |
| 324 | this.showPopup = false | 325 | this.showPopup = false |
| 325 | }, 300) | 326 | }, 300) |
| 326 | }) | 327 | }) |
| 327 | } | 328 | } |
| 328 | } | 329 | } |
| 329 | } | 330 | } |
| 330 | </script> | 331 | </script> |
| 331 | 332 | ||
| 332 | <style lang="scss" scoped> | 333 | <style lang="scss" scoped> |
| 333 | .simple-address { | 334 | .simple-address { |
| 334 | /* #ifndef APP-NVUE */ | 335 | /* #ifndef APP-NVUE */ |
| 335 | display: flex; | 336 | display: flex; |
| 336 | /* #endif */ | 337 | /* #endif */ |
| 337 | flex-direction: column; | 338 | flex-direction: column; |
| 338 | } | 339 | } |
| 339 | 340 | ||
| 340 | .simple-address-mask { | 341 | .simple-address-mask { |
| 341 | position: fixed; | 342 | position: fixed; |
| 342 | bottom: 0; | 343 | bottom: 0; |
| 343 | top: 0; | 344 | top: 0; |
| 344 | left: 0; | 345 | left: 0; |
| 345 | right: 0; | 346 | right: 0; |
| 346 | 347 | ||
| 347 | transition-property: opacity; | 348 | transition-property: opacity; |
| 348 | transition-duration: 0.3s; | 349 | transition-duration: 0.3s; |
| 349 | opacity: 0; | 350 | opacity: 0; |
| 350 | /* #ifndef APP-NVUE */ | 351 | /* #ifndef APP-NVUE */ |
| 351 | z-index: 99; | 352 | z-index: 99; |
| 352 | /* #endif */ | 353 | /* #endif */ |
| 353 | } | 354 | } |
| 354 | 355 | ||
| 355 | .mask-ani { | 356 | .mask-ani { |
| 356 | transition-property: opacity; | 357 | transition-property: opacity; |
| 357 | transition-duration: 0.2s; | 358 | transition-duration: 0.2s; |
| 358 | } | 359 | } |
| 359 | 360 | ||
| 360 | .simple-bottom-mask { | 361 | .simple-bottom-mask { |
| 361 | opacity: 1; | 362 | opacity: 1; |
| 362 | } | 363 | } |
| 363 | 364 | ||
| 364 | .simple-center-mask { | 365 | .simple-center-mask { |
| 365 | opacity: 1; | 366 | opacity: 1; |
| 366 | } | 367 | } |
| 367 | 368 | ||
| 368 | .simple-address--fixed { | 369 | .simple-address--fixed { |
| 369 | position: fixed; | 370 | position: fixed; |
| 370 | bottom: 0; | 371 | bottom: 0; |
| 371 | left: 0; | 372 | left: 0; |
| 372 | right: 0; | 373 | right: 0; |
| 373 | transition-property: transform; | 374 | transition-property: transform; |
| 374 | transition-duration: 0.3s; | 375 | transition-duration: 0.3s; |
| 375 | transform: translateY(460rpx); | 376 | transform: translateY(460rpx); |
| 376 | /* #ifndef APP-NVUE */ | 377 | /* #ifndef APP-NVUE */ |
| 377 | z-index: 99; | 378 | z-index: 99; |
| 378 | /* #endif */ | 379 | /* #endif */ |
| 379 | } | 380 | } |
| 380 | 381 | ||
| 381 | .simple-address-content { | 382 | .simple-address-content { |
| 382 | background-color: #ffffff; | 383 | background-color: #ffffff; |
| 383 | } | 384 | } |
| 384 | 385 | ||
| 385 | .simple-content-bottom { | 386 | .simple-content-bottom { |
| 386 | bottom: 0; | 387 | bottom: 0; |
| 387 | left: 0; | 388 | left: 0; |
| 388 | right: 0; | 389 | right: 0; |
| 389 | transform: translateY(500rpx); | 390 | transform: translateY(500rpx); |
| 390 | } | 391 | } |
| 391 | 392 | ||
| 392 | .content-ani { | 393 | .content-ani { |
| 393 | transition-property: transform, opacity; | 394 | transition-property: transform, opacity; |
| 394 | transition-duration: 0.2s; | 395 | transition-duration: 0.2s; |
| 395 | } | 396 | } |
| 396 | 397 | ||
| 397 | .simple-bottom-content { | 398 | .simple-bottom-content { |
| 398 | transform: translateY(0); | 399 | transform: translateY(0); |
| 399 | } | 400 | } |
| 400 | 401 | ||
| 401 | .simple-center-content { | 402 | .simple-center-content { |
| 402 | transform: scale(1); | 403 | transform: scale(1); |
| 403 | opacity: 1; | 404 | opacity: 1; |
| 404 | } | 405 | } |
| 405 | 406 | ||
| 406 | .simple-address__header { | 407 | .simple-address__header { |
| 407 | position: relative; | 408 | position: relative; |
| 408 | /* #ifndef APP-NVUE */ | 409 | /* #ifndef APP-NVUE */ |
| 409 | display: flex; | 410 | display: flex; |
| 410 | /* #endif */ | 411 | /* #endif */ |
| 411 | flex-direction: row; | 412 | flex-direction: row; |
| 412 | flex-wrap: nowrap; | 413 | flex-wrap: nowrap; |
| 413 | justify-content: space-between; | 414 | justify-content: space-between; |
| 414 | border-bottom-color: #f2f2f2; | 415 | border-bottom-color: #f2f2f2; |
| 415 | border-bottom-style: solid; | 416 | border-bottom-style: solid; |
| 416 | border-bottom-width: 1rpx; | 417 | border-bottom-width: 1rpx; |
| 417 | } | 418 | } |
| 418 | 419 | ||
| 419 | .simple-address--fixed-top { | 420 | .simple-address--fixed-top { |
| 420 | /* #ifndef APP-NVUE */ | 421 | /* #ifndef APP-NVUE */ |
| 421 | display: flex; | 422 | display: flex; |
| 422 | /* #endif */ | 423 | /* #endif */ |
| 423 | flex-direction: row; | 424 | flex-direction: row; |
| 424 | justify-content: space-between; | 425 | justify-content: space-between; |
| 425 | border-top-color: $uni-border-color; | 426 | border-top-color: $uni-border-color; |
| 426 | border-top-style: solid; | 427 | border-top-style: solid; |
| 427 | border-top-width: 1rpx; | 428 | border-top-width: 1rpx; |
| 428 | } | 429 | } |
| 429 | 430 | ||
| 430 | .simple-address__header-btn-box { | 431 | .simple-address__header-btn-box { |
| 431 | /* #ifndef APP-NVUE */ | 432 | /* #ifndef APP-NVUE */ |
| 432 | display: flex; | 433 | display: flex; |
| 433 | /* #endif */ | 434 | /* #endif */ |
| 434 | flex-direction: row; | 435 | flex-direction: row; |
| 435 | align-items: center; | 436 | align-items: center; |
| 436 | justify-content: center; | 437 | justify-content: center; |
| 437 | height: 70rpx; | 438 | height: 70rpx; |
| 438 | } | 439 | } |
| 439 | 440 | ||
| 440 | .simple-address__header-text { | 441 | .simple-address__header-text { |
| 441 | text-align: center; | 442 | text-align: center; |
| 442 | font-size: $uni-font-size-base; | 443 | font-size: $uni-font-size-base; |
| 443 | color: #1aad19; | 444 | color: #1aad19; |
| 444 | line-height: 70rpx; | 445 | line-height: 70rpx; |
| 445 | padding-left: 40rpx; | 446 | padding-left: 40rpx; |
| 446 | padding-right: 40rpx; | 447 | padding-right: 40rpx; |
| 447 | } | 448 | } |
| 448 | 449 | ||
| 449 | .simple-address__box { | 450 | .simple-address__box { |
| 450 | position: relative; | 451 | position: relative; |
| 451 | } | 452 | } |
| 452 | 453 | ||
| 453 | .simple-address-view { | 454 | .simple-address-view { |
| 454 | position: relative; | 455 | position: relative; |
| 455 | bottom: 0; | 456 | bottom: 0; |
| 456 | left: 0; | 457 | left: 0; |
| 457 | /* #ifndef APP-NVUE */ | 458 | /* #ifndef APP-NVUE */ |
| 458 | width: 100%; | 459 | width: 100%; |
| 459 | /* #endif */ | 460 | /* #endif */ |
| 460 | /* #ifdef APP-NVUE */ | 461 | /* #ifdef APP-NVUE */ |
| 461 | width: 750rpx; | 462 | width: 750rpx; |
| 462 | /* #endif */ | 463 | /* #endif */ |
| 463 | height: 408rpx; | 464 | height: 408rpx; |
| 464 | background-color: rgba(255, 255, 255, 1); | 465 | background-color: rgba(255, 255, 255, 1); |
| 465 | } | 466 | } |
| 466 | 467 | ||
| 467 | .picker-item { | 468 | .picker-item { |
| 468 | text-align: center; | 469 | text-align: center; |
| 469 | line-height: 70rpx; | 470 | line-height: 70rpx; |
| 470 | text-overflow: ellipsis; | 471 | text-overflow: ellipsis; |
| 471 | font-size: 28rpx; | 472 | font-size: 28rpx; |
| 472 | } | 473 | } |
| 473 | </style> | 474 | </style> |
| 474 | 475 |
src/pages/address/addAddress.vue
| 1 | <template> | 1 | <template> |
| 2 | <form | 2 | <form |
| 3 | class="wrap" | 3 | class="wrap" |
| 4 | @submit="formSubmit" | 4 | @submit="formSubmit" |
| 5 | @reset="formReset" | 5 | @reset="formReset" |
| 6 | > | 6 | > |
| 7 | <view class="content"> | 7 | <view class="content"> |
| 8 | <view class="item,name"> | 8 | <view class="item,name"> |
| 9 | <text class="itemText">姓名</text> | 9 | <text class="itemText">姓名</text> |
| 10 | <input | 10 | <input |
| 11 | placeholder="收货人姓名(真实姓名)" | 11 | placeholder="收货人姓名(真实姓名)" |
| 12 | placeholder-style="color:#B8B8B8" | 12 | placeholder-style="color:#B8B8B8" |
| 13 | name="name" | 13 | name="name" |
| 14 | :value="name" | 14 | :value="name" |
| 15 | /> | 15 | /> |
| 16 | </view> | 16 | </view> |
| 17 | <view class="item,phone"> | 17 | <view class="item,phone"> |
| 18 | <text class="itemText">电话</text> | 18 | <text class="itemText">电话</text> |
| 19 | <input | 19 | <input |
| 20 | placeholder="手机号" | 20 | placeholder="手机号" |
| 21 | type="digit" | 21 | type="digit" |
| 22 | placeholder-style="color:#B8B8B8" | 22 | placeholder-style="color:#B8B8B8" |
| 23 | name="mobile" | 23 | name="mobile" |
| 24 | v-model="mobile" | 24 | v-model="mobile" |
| 25 | /> | 25 | /> |
| 26 | </view> | 26 | </view> |
| 27 | <view class="item,phone"> | 27 | <view class="item,phone"> |
| 28 | <text class="itemText">性别</text> | 28 | <text class="itemText">性别</text> |
| 29 | <picker | 29 | <picker |
| 30 | @change="bindPickerChange" | 30 | @change="bindPickerChange" |
| 31 | :value="index" | 31 | :value="index" |
| 32 | :range="sexArray" | 32 | :range="sexArray" |
| 33 | name="sex" | 33 | name="sex" |
| 34 | > | 34 | > |
| 35 | <view class="uni-input">{{sexArray[sexIndex]}}</view> | 35 | <view class="uni-input">{{sexArray[sexIndex]}}</view> |
| 36 | </picker> | 36 | </picker> |
| 37 | </view> | 37 | </view> |
| 38 | <view class="item,area"> | 38 | <view class="item,area"> |
| 39 | <text class="itemText">地区</text> | 39 | <text class="itemText">地区</text> |
| 40 | <view | 40 | <view |
| 41 | class="btn" | 41 | class="btn" |
| 42 | v-if="pickerText===''" | 42 | v-if="pickerText===''" |
| 43 | @tap="openAddres" | 43 | @tap="openAddres" |
| 44 | >选择省/市/区</view> | 44 | >选择省/市/区</view> |
| 45 | <view | 45 | <view |
| 46 | class="btn" | 46 | class="btn" |
| 47 | v-else | 47 | v-else |
| 48 | @tap="openAddres" | 48 | @tap="openAddres" |
| 49 | >{{pickerText}}</view> | 49 | >{{pickerText}}</view> |
| 50 | <simple-address | 50 | <simple-address |
| 51 | ref="SimpleAddress" | 51 | ref="SimpleAddress" |
| 52 | :pickerValueDefault="cityPickerValueDefault" | 52 | :pickerValueDefault="cityPickerValueDefault" |
| 53 | @onConfirm="onConfirm" | 53 | @onConfirm="onConfirm" |
| 54 | themeColor="#007AFF" | 54 | themeColor="#007AFF" |
| 55 | name="address" | 55 | name="address" |
| 56 | ></simple-address> | 56 | ></simple-address> |
| 57 | </view> | 57 | </view> |
| 58 | <view class="item,address"> | 58 | <view class="item,address"> |
| 59 | <text class="itemText">详细地址</text> | 59 | <text class="itemText">详细地址</text> |
| 60 | <input | 60 | <input |
| 61 | placeholder="街道、小区门牌等详细地址" | 61 | placeholder="街道、小区门牌等详细地址" |
| 62 | name="addDetail" | 62 | name="addDetail" |
| 63 | :value="addDetial" | 63 | :value="addDetial" |
| 64 | /> | 64 | /> |
| 65 | </view> | 65 | </view> |
| 66 | <view class="item,check"> | 66 | <view class="item,check"> |
| 67 | <text class="itemText">设为默认地址</text> | 67 | <text class="itemText">设为默认地址</text> |
| 68 | <switch | 68 | <switch |
| 69 | :checked="isDefalutAddress" | 69 | :checked="isDefalutAddress" |
| 70 | color="#FF6B4A" | 70 | color="#FF6B4A" |
| 71 | style="transform:scale(0.6)" | 71 | style="transform:scale(0.6)" |
| 72 | @change="changeDefalutAddress" | 72 | @change="changeDefalutAddress" |
| 73 | name="isDefault" | 73 | name="isDefault" |
| 74 | /> | 74 | /> |
| 75 | </view> | 75 | </view> |
| 76 | <input /> | 76 | <input /> |
| 77 | </view> | 77 | </view> |
| 78 | <button | 78 | <button |
| 79 | form-type="submit" | 79 | form-type="submit" |
| 80 | class="button" v-if="addId">编辑</button> | 80 | class="button" v-if="addId">编辑</button> |
| 81 | <button | 81 | <button |
| 82 | form-type="submit" | 82 | form-type="submit" |
| 83 | class="button" | 83 | class="button" |
| 84 | v-else | 84 | v-else |
| 85 | >保存并使用</button> | 85 | >保存并使用</button> |
| 86 | </form> | 86 | </form> |
| 87 | </template> | 87 | </template> |
| 88 | 88 | ||
| 89 | <script> | 89 | <script> |
| 90 | import SimpleAddress from '@/components/SimpleAddress/SimpleAddress.vue' | 90 | import SimpleAddress from '@/components/SimpleAddress/SimpleAddress.vue' |
| 91 | import store from '@/store' | 91 | import store from '@/store' |
| 92 | 92 | ||
| 93 | export default { | 93 | export default { |
| 94 | data () { | 94 | data () { |
| 95 | return { | 95 | return { |
| 96 | cityPickerValueDefault: [0, 0, 1], | 96 | cityPickerValueDefault: [0, 0, 1], |
| 97 | pickerText: '', | 97 | pickerText: '', |
| 98 | isDefalutAddress: true, | 98 | isDefalutAddress: true, |
| 99 | sexArray: ['男', '女'], | 99 | sexArray: ['男', '女'], |
| 100 | sexIndex: 0, | 100 | sexIndex: 0, |
| 101 | flag: 0, | 101 | flag: 0, |
| 102 | addId: undefined, | 102 | addId: undefined, |
| 103 | name: '', | 103 | name: '', |
| 104 | mobile: '', | 104 | mobile: '', |
| 105 | addDetial: '', | 105 | addDetial: '', |
| 106 | isDefault: 0 | 106 | isDefault: 0 |
| 107 | } | 107 | } |
| 108 | }, | 108 | }, |
| 109 | onLoad (option) { | 109 | onLoad (option) { |
| 110 | const { addId } = option | 110 | const { addId } = option |
| 111 | if (addId) { | 111 | if (addId) { |
| 112 | this.addId = addId | 112 | this.addId = addId |
| 113 | store.dispatch('address/details', { | 113 | store.dispatch('address/details', { |
| 114 | add_id: addId | 114 | add_id: addId |
| 115 | }).then(() => { | 115 | }).then(() => { |
| 116 | uni.setNavigationBarTitle({ | 116 | uni.setNavigationBarTitle({ |
| 117 | title: '编辑地址' | 117 | title: '编辑地址' |
| 118 | }) | 118 | }) |
| 119 | const { name, mobile, sex, add_detail: addDetial, default: isDefault } = this.$store.state.address.details | 119 | const { name, mobile, sex, add_detail: addDetial, default: isDefault,address } = this.$store.state.address.details |
| 120 | console.log('---', this.$store.state.address.details) | 120 | console.log('---', this.$store.state.address.details) |
| 121 | const index = this.$refs.SimpleAddress.queryIndex(this.$store.state.address.details.address.split('-'), 'label') | 121 | const index = this.$refs.SimpleAddress.queryIndex(this.$store.state.address.details.address.split('-'), 'label') |
| 122 | console.log(index) | ||
| 122 | this.cityPickerValueDefault = index.index | 123 | this.cityPickerValueDefault = index.index |
| 123 | this.name = name | 124 | this.name = name |
| 124 | this.mobile = Number(mobile) | 125 | this.mobile = Number(mobile) |
| 125 | this.sexIndex = sex | 126 | this.sexIndex = sex |
| 126 | this.addDetial = addDetial | 127 | this.addDetial = addDetial |
| 127 | this.isDefalutAddress = !!Number(isDefault) | 128 | this.isDefalutAddress = !!Number(isDefault) |
| 129 | this.pickerText = address | ||
| 128 | }) | 130 | }) |
| 129 | } | 131 | } |
| 130 | }, | 132 | }, |
| 131 | components: { | 133 | components: { |
| 132 | SimpleAddress | 134 | SimpleAddress |
| 133 | }, | 135 | }, |
| 134 | methods: { | 136 | methods: { |
| 135 | openAddres () { | 137 | openAddres () { |
| 136 | this.cityPickerValueDefault = [0, 0, 1] | 138 | this.cityPickerValueDefault = [0, 0, 1] |
| 137 | this.$refs.SimpleAddress.open() | 139 | this.$refs.SimpleAddress.open() |
| 138 | }, | 140 | }, |
| 139 | onConfirm (e) { | 141 | onConfirm (e) { |
| 140 | this.pickerText = e.label | 142 | this.pickerText = e.label |
| 141 | console.log('lll', e, this.pickerText) | 143 | console.log('lll', e, this.pickerText) |
| 142 | }, | 144 | }, |
| 143 | changeDefalutAddress (e) { | 145 | changeDefalutAddress (e) { |
| 144 | this.isDefalutAddress = e.target.value | 146 | this.isDefalutAddress = e.target.value |
| 145 | }, | 147 | }, |
| 146 | bindPickerChange (e) { | 148 | bindPickerChange (e) { |
| 147 | console.log('picker发送选择改变,携带值为', e.target.value) | 149 | console.log('picker发送选择改变,携带值为', e.target.value) |
| 148 | this.sexIndex = e.target.value | 150 | this.sexIndex = e.target.value |
| 149 | }, | 151 | }, |
| 150 | formValidation (formdata) { | 152 | formValidation (formdata) { |
| 151 | const { name, mobile, addDetail } = formdata | 153 | const { name, mobile, addDetail } = formdata |
| 152 | this.flag = false | 154 | this.flag = false |
| 153 | if (name === '') { | 155 | if (name === '') { |
| 154 | uni.showModal({ | 156 | uni.showModal({ |
| 155 | content: '请输入姓名', | 157 | content: '请输入姓名', |
| 156 | showCancel: false | 158 | showCancel: false |
| 157 | }) | 159 | }) |
| 158 | return 0 | 160 | return 0 |
| 159 | } | 161 | } |
| 160 | if (!(/^1[3456789]\d{9}$/.test(mobile))) { | 162 | if (!(/^1[3456789]\d{9}$/.test(mobile))) { |
| 161 | uni.showModal({ | 163 | uni.showModal({ |
| 162 | content: '请输入正确的手机号', | 164 | content: '请输入正确的手机号', |
| 163 | showCancel: false | 165 | showCancel: false |
| 164 | }) | 166 | }) |
| 165 | return 0 | 167 | return 0 |
| 166 | } | 168 | } |
| 167 | if (this.pickerText === '') { | 169 | if (this.pickerText === '') { |
| 168 | uni.showModal({ | 170 | uni.showModal({ |
| 169 | content: '请选择收货地区', | 171 | content: '请选择收货地区', |
| 170 | showCancel: false | 172 | showCancel: false |
| 171 | }) | 173 | }) |
| 172 | return 0 | 174 | return 0 |
| 173 | } | 175 | } |
| 174 | if (addDetail === '') { | 176 | if (addDetail === '') { |
| 175 | uni.showModal({ | 177 | uni.showModal({ |
| 176 | content: '请输入收货详细地址', | 178 | content: '请输入收货详细地址', |
| 177 | showCancel: false | 179 | showCancel: false |
| 178 | }) | 180 | }) |
| 179 | return 0 | 181 | return 0 |
| 180 | } | 182 | } |
| 181 | this.flag = true | 183 | this.flag = true |
| 182 | }, | 184 | }, |
| 183 | formSubmit (e) { | 185 | formSubmit (e) { |
| 184 | const formdata = e.detail.value | 186 | const formdata = e.detail.value |
| 185 | this.formValidation(formdata) | 187 | this.formValidation(formdata) |
| 186 | 188 | ||
| 187 | const { name, mobile, addDetail, isDefault } = formdata | 189 | const { name, mobile, addDetail, isDefault } = formdata |
| 188 | if (this.flag === true) { | 190 | if (this.flag === true) { |
| 189 | const params = { | 191 | const params = { |
| 190 | sex: this.sexIndex, | 192 | sex: this.sexIndex, |
| 191 | name, | 193 | name, |
| 192 | address: this.pickerText, | 194 | address: this.pickerText, |
| 193 | mobile, | 195 | mobile, |
| 194 | default: isDefault ? 1 : 0, | 196 | default: isDefault ? 1 : 0, |
| 195 | add_detail: addDetail, | 197 | add_detail: addDetail, |
| 196 | longitude: 1, | 198 | longitude: 1, |
| 197 | latitude: 1 | 199 | latitude: 1 |
| 198 | } | 200 | } |
| 199 | if (this.addId) { | 201 | if (this.addId) { |
| 200 | params.add_id = this.addId | 202 | params.add_id = this.addId |
| 201 | } | 203 | } |
| 202 | store.dispatch('address/edit', params).then(() => { | 204 | store.dispatch('address/edit', params).then(() => { |
| 205 | console.log('fanhui') | ||
| 203 | uni.navigateBack({ | 206 | uni.navigateBack({ |
| 204 | delta: 1 | 207 | delta: 1 |
| 205 | }) | 208 | }) |
| 206 | }) | 209 | }) |
| 207 | } | 210 | } |
| 208 | } | 211 | } |
| 209 | } | 212 | } |
| 210 | } | 213 | } |
| 211 | </script> | 214 | </script> |
| 212 | 215 | ||
| 213 | <style lang="scss"> | 216 | <style lang="scss"> |
| 214 | .wrap { | 217 | .wrap { |
| 215 | height: 100vh; | 218 | height: 100vh; |
| 216 | background-color: #f2f2f2; | 219 | background-color: #f2f2f2; |
| 217 | font-family: PingFangSC-Regular; | 220 | font-family: PingFangSC-Regular; |
| 218 | letter-spacing: -0.23px; | 221 | letter-spacing: -0.23px; |
| 219 | padding-top: 19rpx; | 222 | padding-top: 19rpx; |
| 220 | } | 223 | } |
| 221 | .content { | 224 | .content { |
| 222 | background-color: #ffffff; | 225 | background-color: #ffffff; |
| 223 | border-radius: 8px; | 226 | border-radius: 8px; |
| 224 | border-radius: 8px; | 227 | border-radius: 8px; |
| 225 | padding: 40rpx 56rpx; | 228 | padding: 40rpx 56rpx; |
| 226 | margin-left: 40rpx; | 229 | margin-left: 40rpx; |
| 227 | width: 670rpx; | 230 | width: 670rpx; |
| 228 | box-sizing: border-box; | 231 | box-sizing: border-box; |
| 229 | .item { | 232 | .item { |
| 230 | display: flex; | 233 | display: flex; |
| 231 | justify-content: flex-start; | 234 | justify-content: flex-start; |
| 232 | font-size: 14px; | 235 | font-size: 14px; |
| 233 | align-items: center; | 236 | align-items: center; |
| 234 | height: 112rpx; | 237 | height: 112rpx; |
| 235 | border-bottom: 1rpx solid #e9e9e9; | 238 | border-bottom: 1rpx solid #e9e9e9; |
| 236 | .itemText { | 239 | .itemText { |
| 237 | width: 162rpx; | 240 | width: 162rpx; |
| 238 | font-family: PingFangSC-Regular; | 241 | font-family: PingFangSC-Regular; |
| 239 | letter-spacing: -0.26px; | 242 | letter-spacing: -0.26px; |
| 240 | } | 243 | } |
| 241 | .btn { | 244 | .btn { |
| 242 | color: #333333 !important; | 245 | color: #333333 !important; |
| 243 | } | 246 | } |
| 244 | } | 247 | } |
| 245 | .check { | 248 | .check { |
| 246 | justify-content: space-between; | 249 | justify-content: space-between; |
| 247 | } | 250 | } |
| 248 | } | 251 | } |
| 249 | .button { | 252 | .button { |
| 250 | position: fixed; | 253 | position: fixed; |
| 251 | bottom: 0; | 254 | bottom: 0; |
| 252 | left: 0; | 255 | left: 0; |
| 253 | height: 112rpx; | 256 | height: 112rpx; |
| 254 | width: 100%; | 257 | width: 100%; |
| 255 | background: #ff6b4a; | 258 | background: #ff6b4a; |
| 256 | display: flex; | 259 | display: flex; |
| 257 | justify-content: center; | 260 | justify-content: center; |
| 258 | align-items: center; | 261 | align-items: center; |
| 259 | font-size: 16px; | 262 | font-size: 16px; |
| 260 | color: #ffffff; | 263 | color: #ffffff; |
| 261 | letter-spacing: -0.3px; | 264 | letter-spacing: -0.3px; |
| 262 | } | 265 | } |
| 263 | </style> | 266 | </style> |
| 264 | 267 |
src/pages/address/addressList.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="content"> | 2 | <view class="content"> |
| 3 | <view | 3 | <view |
| 4 | v-if="addressList.length !== 0" | 4 | v-if="addressList.length !== 0" |
| 5 | class="list" | 5 | class="list" |
| 6 | > | 6 | > |
| 7 | <view | 7 | <view |
| 8 | v-for="(item, index) in addressList" | 8 | v-for="(item, index) in addressList" |
| 9 | :key="index" | 9 | :key="index" |
| 10 | class="order-user" | 10 | class="order-user" |
| 11 | @tap="toOrder(item.add_id)" | 11 | @tap="toOrder(item.add_id)" |
| 12 | > | 12 | > |
| 13 | <view class="order-user-head"> | 13 | <view class="order-user-head"> |
| 14 | <view class="name"> | 14 | <view class="name"> |
| 15 | <view | 15 | <view |
| 16 | v-if="item.default === '1'" | 16 | v-if="item.default === '1'" |
| 17 | class="default" | 17 | class="default" |
| 18 | ><text>默认</text></view>{{item.name}} | 18 | ><text>默认</text></view>{{item.name}} |
| 19 | </view> | 19 | </view> |
| 20 | <text class="mobile">{{item.mobile}}</text> | 20 | <text class="mobile">{{item.mobile}}</text> |
| 21 | </view> | 21 | </view> |
| 22 | <view class="order-user-body"> | 22 | <view class="order-user-body"> |
| 23 | <image src="../../static/myorder-paying-location.png"></image> | 23 | <image src="../../static/myorder-paying-location.png"></image> |
| 24 | <text class="address">{{item.address.replace(/[-]/g,' ')}}\n{{item.add_detail}}</text> | 24 | <text class="address">{{item.address.replace(/[-]/g,' ')}}\n{{item.add_detail}}</text> |
| 25 | </view> | 25 | </view> |
| 26 | <image | 26 | <image |
| 27 | @tap="toEditAddress(item.add_id)" | 27 | @click.stop="toEditAddress(item.add_id)" |
| 28 | v-if="item.default === '1'" | 28 | v-if="item.default === '1'" |
| 29 | class="arrow" | 29 | class="arrow" |
| 30 | src="../../static/right.png" | 30 | src="../../static/right.png" |
| 31 | ></image> | 31 | ></image> |
| 32 | <image | 32 | <image |
| 33 | @tap="toEditAddress(item.add_id)" | 33 | @click.stop="toEditAddress(item.add_id)" |
| 34 | v-else | 34 | v-else |
| 35 | class="arrow pen" | 35 | class="arrow pen" |
| 36 | src="../../static/icon-pen.png" | 36 | src="../../static/icon-pen.png" |
| 37 | ></image> | 37 | ></image> |
| 38 | </view> | 38 | </view> |
| 39 | </view> | 39 | </view> |
| 40 | <view | 40 | <view |
| 41 | v-else | 41 | v-else |
| 42 | class="empty" | 42 | class="empty" |
| 43 | > | 43 | > |
| 44 | 暂无收货地址 | 44 | 暂无收货地址 |
| 45 | </view> | 45 | </view> |
| 46 | <button @tap="toAddAddress" class="add">新建收货地址</button> | 46 | <button @tap="toAddAddress" class="add">新建收货地址</button> |
| 47 | </view> | 47 | </view> |
| 48 | </template> | 48 | </template> |
| 49 | 49 | ||
| 50 | <script> | 50 | <script> |
| 51 | import store from '@/store' | 51 | import store from '@/store' |
| 52 | export default { | 52 | export default { |
| 53 | data () { | 53 | data () { |
| 54 | return {} | 54 | return {} |
| 55 | }, | 55 | }, |
| 56 | computed: { | 56 | computed: { |
| 57 | addressList () { | 57 | addressList () { |
| 58 | return this.$store.state.address.list | 58 | return this.$store.state.address.list |
| 59 | } | 59 | } |
| 60 | }, | 60 | }, |
| 61 | onLoad ({ edit }) { | 61 | onLoad ({ edit }) { |
| 62 | if (edit) { | 62 | if (edit) { |
| 63 | this.edit = true | 63 | this.edit = true |
| 64 | } | 64 | } |
| 65 | store.dispatch('address/list') | 65 | store.dispatch('address/list') |
| 66 | }, | 66 | }, |
| 67 | onShow() { | ||
| 68 | store.dispatch('address/list') | ||
| 69 | }, | ||
| 67 | methods: { | 70 | methods: { |
| 68 | toAddAddress() { | 71 | toAddAddress() { |
| 69 | console.log('aaaaa-a') | 72 | console.log('aaaaa-a') |
| 70 | uni.navigateTo({ | 73 | uni.navigateTo({ |
| 71 | url: 'addAddress', | 74 | url: 'addAddress', |
| 72 | fail: (error) => { | 75 | fail: (error) => { |
| 73 | console.error('跳转出现错误', error) | 76 | console.error('跳转出现错误', error) |
| 74 | } | 77 | } |
| 75 | }) | 78 | }) |
| 76 | }, | 79 | }, |
| 77 | toEditAddress (addId) { | 80 | toEditAddress (addId) { |
| 78 | console.log('addId', addId) | 81 | console.log('addId', addId) |
| 79 | uni.navigateTo({ | 82 | uni.navigateTo({ |
| 80 | url: `addAddress?addId=${addId}`, | 83 | url: `addAddress?addId=${addId}`, |
| 81 | fail: (error) => { | 84 | fail: (error) => { |
| 82 | console.error('跳转出现错误', error) | 85 | console.error('跳转出现错误', error) |
| 83 | } | 86 | } |
| 84 | }) | 87 | }) |
| 85 | }, | 88 | }, |
| 86 | toOrder (addId) { | 89 | toOrder (addId) { |
| 87 | if (this.edit) { | 90 | if (this.edit) { |
| 88 | uni.navigateTo({ | 91 | let pages = getCurrentPages(); |
| 89 | url: `../confirmOrder/confirmOrder?addressId=${addId}`, | 92 | let prevPage = pages[pages.length - 2]; //上一个页面 |
| 90 | fail: (error) => { | 93 | const addressId=addId |
| 91 | console.error('跳转出现错误', error) | 94 | // console.log(addressId) |
| 92 | } | 95 | prevPage.onShow(addressId); |
| 93 | }) | 96 | uni.navigateBack(); |
| 97 | // uni.navigateTo({ | ||
| 98 | // url: `../confirmOrder/confirmOrder?addressId=${addId}`, | ||
| 99 | // fail: (error) => { | ||
| 100 | // console.error('跳转出现错误', error) | ||
| 101 | // } | ||
| 102 | // }) | ||
| 94 | } | 103 | } |
| 95 | } | 104 | } |
| 96 | } | 105 | } |
| 97 | } | 106 | } |
| 98 | </script> | 107 | </script> |
| 99 | 108 | ||
| 100 | <style lang="scss"> | 109 | <style lang="scss"> |
| 101 | .content { | 110 | .content { |
| 102 | min-height: 100vh; | 111 | min-height: 100vh; |
| 103 | background-color: #f2f2f2; | 112 | background-color: #f2f2f2; |
| 104 | padding-top: 20rpx; | 113 | padding-top: 20rpx; |
| 105 | padding-bottom: 112rpx; | 114 | padding-bottom: 112rpx; |
| 106 | .order-user { | 115 | .order-user { |
| 107 | width: 670rpx; | 116 | width: 670rpx; |
| 108 | height: 228rpx; | 117 | height: 228rpx; |
| 109 | background: #ffffff; | 118 | background: #ffffff; |
| 110 | border-radius: 14rpx; | 119 | border-radius: 14rpx; |
| 111 | margin: 0 auto; | 120 | margin: 0 auto; |
| 112 | margin-bottom: 20rpx; | 121 | margin-bottom: 20rpx; |
| 113 | position: relative; | 122 | position: relative; |
| 114 | .order-user-head { | 123 | .order-user-head { |
| 115 | display: flex; | 124 | display: flex; |
| 116 | height: 108rpx; | 125 | height: 108rpx; |
| 117 | width: 100%; | 126 | width: 100%; |
| 118 | align-items: center; | 127 | align-items: center; |
| 119 | margin-left: 126rpx; | 128 | padding-left: 126rpx; |
| 129 | box-sizing: border-box; | ||
| 120 | .name { | 130 | .name { |
| 121 | display: flex; | 131 | display: flex; |
| 122 | justify-content: space-between; | 132 | justify-content: space-between; |
| 123 | font-size: 14px; | 133 | font-size: 14px; |
| 124 | color: #333333; | 134 | color: #333333; |
| 125 | letter-spacing: -0.26px; | 135 | letter-spacing: -0.26px; |
| 126 | margin-right: 20rpx; | 136 | margin-right: 20rpx; |
| 127 | .default { | 137 | .default { |
| 128 | height: 40rpx; | 138 | height: 40rpx; |
| 129 | width: 80rpx; | 139 | width: 80rpx; |
| 130 | background-color: #4a90e2; | 140 | background-color: #4a90e2; |
| 131 | border-radius: 13px; | 141 | border-radius: 13px; |
| 132 | border-radius: 13px; | 142 | border-radius: 13px; |
| 133 | text-align: center; | 143 | text-align: center; |
| 134 | margin-right: 20rpx; | 144 | margin-right: 20rpx; |
| 135 | text { | 145 | text { |
| 136 | display: flex; | 146 | display: flex; |
| 137 | justify-content: center; | 147 | justify-content: center; |
| 138 | align-items: center; | 148 | align-items: center; |
| 139 | font-size: 12px; | 149 | font-size: 12px; |
| 140 | color: #ffffff; | 150 | color: #ffffff; |
| 141 | letter-spacing: -0.23px; | 151 | letter-spacing: -0.23px; |
| 142 | } | 152 | } |
| 143 | } | 153 | } |
| 144 | } | 154 | } |
| 145 | .mobile { | 155 | .mobile { |
| 146 | font-size: 14px; | 156 | font-size: 14px; |
| 147 | color: #999999; | 157 | color: #999999; |
| 148 | letter-spacing: -0.26px; | 158 | letter-spacing: -0.26px; |
| 149 | } | 159 | } |
| 150 | } | 160 | } |
| 151 | .order-user-body { | 161 | .order-user-body { |
| 152 | display: flex; | 162 | display: flex; |
| 153 | width: 100%; | 163 | width: 100%; |
| 154 | image { | 164 | image { |
| 155 | width: 24px; | 165 | width: 24px; |
| 156 | height: 26px; | 166 | height: 26px; |
| 157 | margin: 12rpx 32rpx 0 40rpx; | 167 | margin: 12rpx 32rpx 0 40rpx; |
| 158 | } | 168 | } |
| 159 | .address { | 169 | .address { |
| 160 | font-weight: bold; | 170 | font-weight: bold; |
| 161 | font-size: 14px; | 171 | font-size: 14px; |
| 162 | color: #333333; | 172 | color: #333333; |
| 163 | letter-spacing: -0.26px; | 173 | letter-spacing: -0.26px; |
| 164 | } | 174 | } |
| 165 | } | 175 | } |
| 166 | .arrow { | 176 | .arrow { |
| 167 | width: 12px; | 177 | width: 12px; |
| 168 | height: 12px; | 178 | height: 12px; |
| 169 | position: absolute; | 179 | position: absolute; |
| 170 | right: 40rpx; | 180 | right: 40rpx; |
| 171 | bottom: 104rpx; | 181 | bottom: 104rpx; |
| 172 | } | 182 | } |
| 173 | } | 183 | } |
| 174 | .empty { | 184 | .empty { |
| 175 | color: #666; | 185 | color: #666; |
| 176 | font-size: 16px; | 186 | font-size: 16px; |
| 177 | text-align: center; | 187 | text-align: center; |
| 178 | padding-top: 30vh; | 188 | padding-top: 30vh; |
| 179 | } | 189 | } |
| 180 | .add { | 190 | .add { |
| 181 | position: fixed; | 191 | position: fixed; |
| 182 | bottom: 0; | 192 | bottom: 0; |
| 183 | left: 0; | 193 | left: 0; |
| 184 | height: 112rpx; | 194 | height: 112rpx; |
| 185 | width: 100%; | 195 | width: 100%; |
| 186 | background-color: #ff6b4a; | 196 | background-color: #ff6b4a; |
| 187 | display: flex; | 197 | display: flex; |
| 188 | justify-content: center; | 198 | justify-content: center; |
| 189 | align-items: center; | 199 | align-items: center; |
| 190 | font-size: 16px; | 200 | font-size: 16px; |
| 191 | color: #ffffff; | 201 | color: #ffffff; |
| 192 | letter-spacing: -0.3px; | 202 | letter-spacing: -0.3px; |
| 193 | } | 203 | } |
| 194 | } | 204 | } |
| 195 | </style> | 205 | </style> |
| 196 | 206 |
src/pages/confirmOrder/confirmOrder.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="wrap"> | 2 | <view class="wrap"> |
| 3 | <view></view> | 3 | <view></view> |
| 4 | <view | 4 | <view |
| 5 | class="addAddress" | 5 | class="addAddress" |
| 6 | @tap="toaddAddress" | 6 | @tap="toaddAddress" |
| 7 | v-if="this.showAddress" | 7 | v-if="this.showAddress" |
| 8 | > | 8 | > |
| 9 | <view class="addIcon"> | 9 | <view class="addIcon"> |
| 10 | <image | 10 | <image |
| 11 | src="../../static/add.png" | 11 | src="../../static/add.png" |
| 12 | mode="aspectFill" | 12 | mode="aspectFill" |
| 13 | ></image> | 13 | ></image> |
| 14 | </view> | 14 | </view> |
| 15 | <view class="addressText">{{addAddress}}</view> | 15 | <view class="addressText">{{addAddress}}</view> |
| 16 | <image | 16 | <image |
| 17 | src="../../static/right.png" | 17 | src="../../static/right.png" |
| 18 | mode="aspectFill" | 18 | mode="aspectFill" |
| 19 | ></image> | 19 | ></image> |
| 20 | </view> | 20 | </view> |
| 21 | <view | 21 | <view |
| 22 | v-else | 22 | v-else |
| 23 | @tap="toaddAddress" | 23 | @tap="toaddAddress" |
| 24 | class="list order-user" | 24 | class="list order-user" |
| 25 | > | 25 | > |
| 26 | <view class="order-user-head"> | 26 | <view class="order-user-head"> |
| 27 | <view class="name"> | 27 | <view class="name"> |
| 28 | <view | 28 | <view |
| 29 | v-if="addressInfo.default === '1'" | 29 | v-if="addressInfo.default === '1'" |
| 30 | class="default" | 30 | class="default" |
| 31 | ><text>默认</text></view>{{addressInfo.name}} | 31 | ><text>默认</text></view>{{addressInfo.name}} |
| 32 | </view> | 32 | </view> |
| 33 | <text class="mobile">{{addressInfo.mobile}}</text> | 33 | <text class="mobile">{{addressInfo.mobile}}</text> |
| 34 | </view> | 34 | </view> |
| 35 | <view class="order-user-body"> | 35 | <view class="order-user-body"> |
| 36 | <image src="../../static/myorder-paying-location.png"></image> | 36 | <image src="../../static/myorder-paying-location.png"></image> |
| 37 | <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> | 37 | <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> |
| 38 | </view> | 38 | </view> |
| 39 | <image | 39 | <image |
| 40 | class="arrow" | 40 | class="arrow" |
| 41 | src="../../static/right.png" | 41 | src="../../static/right.png" |
| 42 | mode="aspectFill" | 42 | mode="aspectFill" |
| 43 | ></image> | 43 | ></image> |
| 44 | </view> | 44 | </view> |
| 45 | <view class="content"> | 45 | <view class="content"> |
| 46 | <view class="orderInfo"> | 46 | <view class="orderInfo"> |
| 47 | <view class="title"> | 47 | <view class="title"> |
| 48 | <image | 48 | <image |
| 49 | src="../../static/store.png" | 49 | src="../../static/store.png" |
| 50 | mode="aspectFill" | 50 | mode="aspectFill" |
| 51 | style="width: 40rpx;height: 40rpx;" | 51 | style="width: 40rpx;height: 40rpx;" |
| 52 | ></image> | 52 | ></image> |
| 53 | <text>非常戴镜</text> | 53 | <text>非常戴镜</text> |
| 54 | </view> | 54 | </view> |
| 55 | <view class="infoBox"> | 55 | <view class="infoBox"> |
| 56 | <view class="infoTop"> | 56 | <view class="infoTop"> |
| 57 | <image | 57 | <image |
| 58 | :src="goodInfo.img_index_url" | 58 | :src="goodInfo.img_index_url" |
| 59 | mode="aspectFill" | 59 | mode="aspectFill" |
| 60 | ></image> | 60 | ></image> |
| 61 | <view class="infoRight"> | 61 | <view class="infoRight"> |
| 62 | <text class="goodName">{{goodInfo.p_name}}</text> | 62 | <text class="goodName">{{goodInfo.p_name}}</text> |
| 63 | <text class="remarks">支持7天无理由退货 顺丰发货</text> | 63 | <text class="remarks">支持7天无理由退货 顺丰发货</text> |
| 64 | <view class="priceBox"> | 64 | <view class="priceBox"> |
| 65 | <view class="price">¥{{Number(skuInfo.real_price) * count}}<text class="originCost"> | 65 | <view class="price">¥{{Number(skuInfo.real_price) * count}}<text class="originCost"> |
| 66 | ¥{{parseInt(skuInfo.real_price * (1 + Number(skuInfo.discount) / 100))}} | 66 | ¥{{parseInt(skuInfo.real_price * (1 + Number(skuInfo.discount) / 100))}} |
| 67 | </text></view> | 67 | </text></view> |
| 68 | <view class="counter"> | 68 | <view class="counter"> |
| 69 | <view | 69 | <view |
| 70 | class="btn" | 70 | class="btn" |
| 71 | disabled="this.disabled" | 71 | disabled="this.disabled" |
| 72 | type="default" | 72 | type="default" |
| 73 | @click="counter(false)" | 73 | @click="counter(false)" |
| 74 | >-</view> | 74 | >-</view> |
| 75 | <text>{{count}}</text> | 75 | <text>{{count}}</text> |
| 76 | <view | 76 | <view |
| 77 | class="btn" | 77 | class="btn" |
| 78 | type="default" | 78 | type="default" |
| 79 | @click="counter(true)" | 79 | @click="counter(true)" |
| 80 | >+</view> | 80 | >+</view> |
| 81 | </view> | 81 | </view> |
| 82 | </view> | 82 | </view> |
| 83 | </view> | 83 | </view> |
| 84 | </view> | 84 | </view> |
| 85 | <view class="infoBottom"> | 85 | <view class="infoBottom"> |
| 86 | <view class="norm">规格 <text> | 86 | <view class="norm">规格 <text> |
| 87 | <!-- 长度超出变省略号未做 --> | 87 | <!-- 长度超出变省略号未做 --> |
| 88 | <block | 88 | <block |
| 89 | v-for="(item, index) in current" | 89 | v-for="(item, index) in current" |
| 90 | :key="index" | 90 | :key="index" |
| 91 | >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> | 91 | >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> |
| 92 | </block> | 92 | </block> |
| 93 | </text></view> | 93 | </text></view> |
| 94 | <view class="shippingMethod">使用人 <text> | 94 | <view class="shippingMethod">使用人 <text> |
| 95 | {{name}} | 95 | {{name}} |
| 96 | </text></view> | 96 | </text></view> |
| 97 | <view class="shippingMethod">配送方式 <text>快递</text></view> | 97 | <view class="shippingMethod">配送方式 <text>快递</text></view> |
| 98 | <view class="message">买家留言 | 98 | <view class="message">买家留言 |
| 99 | <input | 99 | <input |
| 100 | type="text" | 100 | type="text" |
| 101 | :value="note" | 101 | :value="note" |
| 102 | placeholder="建议提前协商(50字以内)" | 102 | placeholder="建议提前协商(50字以内)" |
| 103 | /> | 103 | /> |
| 104 | </view> | 104 | </view> |
| 105 | </view> | 105 | </view> |
| 106 | </view> | 106 | </view> |
| 107 | </view> | 107 | </view> |
| 108 | <view class="payWay"> | 108 | <view class="payWay"> |
| 109 | <view class="item"> | 109 | <view class="item"> |
| 110 | <text>支付方式</text> | 110 | <text>支付方式</text> |
| 111 | <view class="itemRight"> | 111 | <view class="itemRight"> |
| 112 | <view class="rightText"> | 112 | <view class="rightText"> |
| 113 | <view class="choosePayWay"> | 113 | <view class="choosePayWay"> |
| 114 | <image | 114 | <image |
| 115 | src="../../static/chat_logo.png" | 115 | src="../../static/chat_logo.png" |
| 116 | mode="aspectFill" | 116 | mode="aspectFill" |
| 117 | ></image> | 117 | ></image> |
| 118 | <text>微信支付</text> | 118 | <text>微信支付</text> |
| 119 | </view> | 119 | </view> |
| 120 | <!-- <view class="randomSubstraction">最高随机立减¥99</view> --> | 120 | <!-- <view class="randomSubstraction">最高随机立减¥99</view> --> |
| 121 | </view> | 121 | </view> |
| 122 | <!-- <image | 122 | <!-- <image |
| 123 | src="../../static/right.png" | 123 | src="../../static/right.png" |
| 124 | mode="aspectFill" | 124 | mode="aspectFill" |
| 125 | ></image> --> | 125 | ></image> --> |
| 126 | </view> | 126 | </view> |
| 127 | </view> | 127 | </view> |
| 128 | <!-- <view class="item"> | 128 | <!-- <view class="item"> |
| 129 | <text>优惠券</text> | 129 | <text>优惠券</text> |
| 130 | <view class="itemRight"> | 130 | <view class="itemRight"> |
| 131 | <view class="rightText"> | 131 | <view class="rightText"> |
| 132 | <view class="chooseOffers"> | 132 | <view class="chooseOffers"> |
| 133 | <text>-¥70.00</text> | 133 | <text>-¥70.00</text> |
| 134 | </view> | 134 | </view> |
| 135 | <view class="preferentialWay">最大优惠</view> | 135 | <view class="preferentialWay">最大优惠</view> |
| 136 | </view> | 136 | </view> |
| 137 | <image | 137 | <image |
| 138 | src="../../static/right.png" | 138 | src="../../static/right.png" |
| 139 | mode="aspectFill" | 139 | mode="aspectFill" |
| 140 | ></image> | 140 | ></image> |
| 141 | </view> | 141 | </view> |
| 142 | </view> --> | 142 | </view> --> |
| 143 | <view class="item"> | 143 | <view class="item"> |
| 144 | <text>运费</text> | 144 | <text>运费</text> |
| 145 | <view class="itemRight"> | 145 | <view class="itemRight"> |
| 146 | <view class="freight">免运费</view> | 146 | <view class="freight">免运费</view> |
| 147 | </view> | 147 | </view> |
| 148 | </view> | 148 | </view> |
| 149 | <view class="item"> | 149 | <view class="item"> |
| 150 | <text>合计</text> | 150 | <text>合计</text> |
| 151 | <view class="itemRight"> | 151 | <view class="itemRight"> |
| 152 | <view class="total">¥{{Number(skuInfo.real_price) * count}}</view> | 152 | <view class="total">¥{{Number(skuInfo.real_price) * count}}</view> |
| 153 | </view> | 153 | </view> |
| 154 | </view> | 154 | </view> |
| 155 | </view> | 155 | </view> |
| 156 | <!-- | 156 | <!-- |
| 157 | <view class="checkBox"> | 157 | <view class="checkBox"> |
| 158 | <checkbox-group> | 158 | <checkbox-group> |
| 159 | <label> | 159 | <label> |
| 160 | <checkbox color="#FF6B4A" value="isAnonymous" checked="true" />匿名购买 | 160 | <checkbox color="#FF6B4A" value="isAnonymous" checked="true" />匿名购买 |
| 161 | </label> | 161 | </label> |
| 162 | </checkbox-group> | 162 | </checkbox-group> |
| 163 | </view> --> | 163 | </view> --> |
| 164 | </view> | 164 | </view> |
| 165 | <view class="last_zhanwei"></view> | 165 | <view class="last_zhanwei"></view> |
| 166 | <view class="footer"> | 166 | <view class="footer"> |
| 167 | <view class="footerLeft">实付金额:<text>¥{{Number(skuInfo.real_price) * count}}</text></view> | 167 | <view class="footerLeft">实付金额:<text>¥{{Number(skuInfo.real_price) * count}}</text></view> |
| 168 | <view class="footerRight"> | 168 | <view class="footerRight"> |
| 169 | <view | 169 | <view |
| 170 | class="paybtn" | 170 | class="paybtn" |
| 171 | @tap="orderBuild" | 171 | @tap="orderBuild" |
| 172 | >立即支付</view> | 172 | >立即支付</view> |
| 173 | </view> | 173 | </view> |
| 174 | </view> | 174 | </view> |
| 175 | </view> | 175 | </view> |
| 176 | </template> | 176 | </template> |
| 177 | 177 | ||
| 178 | <script> | 178 | <script> |
| 179 | import store from '@/store' | 179 | import store from '@/store' |
| 180 | import MD5Util from '../../utils/md5' | 180 | import MD5Util from '../../utils/md5' |
| 181 | 181 | ||
| 182 | export default { | 182 | export default { |
| 183 | data() { | 183 | data() { |
| 184 | return { | 184 | return { |
| 185 | name:String, | 185 | name:String, |
| 186 | addAddress: '添加收货地址', | 186 | addAddress: '添加收货地址', |
| 187 | count: 1, | 187 | count: 1, |
| 188 | pid: 0, | 188 | pid: 0, |
| 189 | disabled: false, | 189 | disabled: false, |
| 190 | freight: 0.0, | 190 | freight: 0.0, |
| 191 | showAddress: false, | 191 | showAddress: false, |
| 192 | note: '', | 192 | note: '', |
| 193 | addressInfo: { | 193 | addressInfo: { |
| 194 | address: '', | 194 | address: '', |
| 195 | }, | 195 | }, |
| 196 | // isAnonymous: | 196 | // isAnonymous: |
| 197 | } | 197 | } |
| 198 | }, | 198 | }, |
| 199 | onLoad({ pid, addressId, isCart ,count,name}) { | 199 | onShow(addressId) { |
| 200 | // console.log('+-+-*-*-+-+',addressId) | ||
| 201 | if (addressId) { | ||
| 202 | store | ||
| 203 | .dispatch('address/details', { | ||
| 204 | add_id: addressId, | ||
| 205 | }) | ||
| 206 | .then(({ code, data }) => { | ||
| 207 | if (code === 1) { | ||
| 208 | // console.log('code', code, data) | ||
| 209 | this.showAddress = true | ||
| 210 | this.addressInfo = data | ||
| 211 | } | ||
| 212 | }) | ||
| 213 | } | ||
| 214 | }, | ||
| 215 | onLoad({ pid, addressId,isCart ,count,name}) { | ||
| 200 | this.pid = pid; | 216 | this.pid = pid; |
| 201 | this.count = count; | 217 | this.count = count; |
| 202 | this.name = name; | 218 | this.name = name; |
| 203 | store.dispatch('read/fetch', { | 219 | store.dispatch('read/fetch', { |
| 204 | pid, | 220 | pid, |
| 205 | }) | 221 | }) |
| 206 | console.log('++++++++++++'+pid,addressId,isCart,count) | 222 | console.log('++++++++++++'+pid,addressId,isCart,count) |
| 207 | // 若已经选择地址 | 223 | // 若已经选择地址 |
| 208 | if (addressId) { | 224 | if (addressId) { |
| 209 | store | 225 | store |
| 210 | .dispatch('address/details', { | 226 | .dispatch('address/details', { |
| 211 | add_id: addressId, | 227 | add_id: addressId, |
| 212 | }) | 228 | }) |
| 213 | .then(({ code, data }) => { | 229 | .then(({ code, data }) => { |
| 214 | if (code === 1) { | 230 | if (code === 1) { |
| 215 | console.log('code', code, data) | 231 | console.log('code', code, data) |
| 216 | this.showAddress = true | 232 | this.showAddress = true |
| 217 | this.addressInfo = data | 233 | this.addressInfo = data |
| 218 | } | 234 | } |
| 219 | }) | 235 | }) |
| 220 | } else { | 236 | } else { |
| 221 | store.dispatch('address/default').then(({ code, data }) => { | 237 | store.dispatch('address/default').then(({ code, data }) => { |
| 222 | if (code === 1) { | 238 | if (code === 1) { |
| 223 | console.log('code', code, data) | 239 | console.log('code', code, data) |
| 224 | this.showAddress = true | 240 | this.showAddress = true |
| 225 | this.addressInfo = data | 241 | this.addressInfo = data |
| 226 | } | 242 | } |
| 227 | }) | 243 | }) |
| 228 | } | 244 | } |
| 229 | }, | 245 | }, |
| 230 | computed: { | 246 | computed: { |
| 231 | goodInfo() { | 247 | goodInfo() { |
| 232 | console.log('state', this.$store.state.read.goodInfo) | 248 | console.log('state', this.$store.state.read.goodInfo) |
| 233 | return this.$store.state.read.goodInfo | 249 | return this.$store.state.read.goodInfo |
| 234 | }, | 250 | }, |
| 235 | skuInfo() { | 251 | skuInfo() { |
| 236 | return this.$store.state.order.param.sk_id_arr | 252 | return this.$store.state.order.param.sk_id_arr |
| 237 | }, | 253 | }, |
| 238 | attrList() { | 254 | attrList() { |
| 239 | return this.$store.state.order.param.attrList | 255 | return this.$store.state.order.param.attrList |
| 240 | }, | 256 | }, |
| 241 | current() { | 257 | current() { |
| 242 | return this.$store.state.order.param.current | 258 | return this.$store.state.order.param.current |
| 243 | }, | 259 | }, |
| 244 | }, | 260 | }, |
| 245 | methods: { | 261 | methods: { |
| 246 | counter(isadd) { | 262 | counter(isadd) { |
| 247 | if (isadd) { | 263 | if (isadd) { |
| 248 | this.count++ | 264 | this.count++ |
| 249 | } else { | 265 | } else { |
| 250 | this.count <= 1 ? (this.disabled = true) : this.count-- | 266 | this.count <= 1 ? (this.disabled = true) : this.count-- |
| 251 | } | 267 | } |
| 252 | }, | 268 | }, |
| 253 | // 跳转添加地址页面 | 269 | // 跳转添加地址页面 |
| 254 | toaddAddress() { | 270 | toaddAddress() { |
| 255 | uni.navigateTo({ | 271 | uni.navigateTo({ |
| 256 | url: `../address/addressList?edit=${1}`, | 272 | url: `../address/addressList?edit=${1}`, |
| 257 | success: res => {}, | 273 | success: res => {}, |
| 258 | fail: error => { | 274 | fail: error => { |
| 259 | console.log('跳转到地址列表页面失败====>', error) | 275 | console.log('跳转到地址列表页面失败====>', error) |
| 260 | }, | 276 | }, |
| 261 | complete: () => {}, | 277 | complete: () => {}, |
| 262 | }) | 278 | }) |
| 263 | }, | 279 | }, |
| 264 | // 下单 | 280 | // 下单 |
| 265 | orderBuild() { | 281 | orderBuild() { |
| 266 | uni.showLoading({ | 282 | uni.showLoading({ |
| 267 | title: '支付中', | 283 | title: '支付中', |
| 268 | }) | 284 | }) |
| 269 | console.log('this', this.$store.state) | 285 | console.log('this', this.$store.state) |
| 270 | const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param | 286 | const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param |
| 271 | store.dispatch('order/buyNow', { | 287 | store.dispatch('order/buyNow', { |
| 272 | pid: skId.pid, | 288 | pid: skId.pid, |
| 273 | sk_id: skId.sk_id, | 289 | sk_id: skId.sk_id, |
| 274 | number: this.count, | 290 | number: this.count, |
| 275 | mp_id: mpId, | 291 | mp_id: mpId, |
| 276 | address: JSON.stringify(this.addressInfo), | 292 | address: JSON.stringify(this.addressInfo), |
| 277 | totalPrice: Number(this.skuInfo.real_price) * this.count * 100, | 293 | totalPrice: Number(this.skuInfo.real_price) * this.count * 100, |
| 278 | liuyan: this.note, | 294 | liuyan: this.note, |
| 279 | dir: 1, | 295 | dir: 1, |
| 280 | }).then((res) => { | 296 | }).then((res) => { |
| 281 | this.pay(res.data) | 297 | this.pay(res.data) |
| 282 | }) | 298 | }) |
| 283 | }, | 299 | }, |
| 284 | // 支付 | 300 | // 支付 |
| 285 | pay(res) { | 301 | pay(res) { |
| 286 | console.log('pay', res) | 302 | console.log('pay', res) |
| 287 | const { data, exKeyName: keyName } = res | 303 | const { data, exKeyName: keyName } = res |
| 288 | const uid = uni.getStorageSync('uid') | 304 | const uid = uni.getStorageSync('uid') |
| 289 | const timeStamp = new Date().getTime().toString() | 305 | const timeStamp = new Date().getTime().toString() |
| 290 | const nonceStr = 'asfafasfasfasfasf' | 306 | const nonceStr = 'asfafasfasfasfasf' |
| 291 | // 支付参数 | 307 | // 支付参数 |
| 292 | const fieldSet = { | 308 | const fieldSet = { |
| 293 | openid: this.$store.state.user.userInfo.openid, | 309 | openid: this.$store.state.user.userInfo.openid, |
| 294 | uid: this.$store.state.user.userInfo.uid, | 310 | uid: this.$store.state.user.userInfo.uid, |
| 295 | shopid: 0, | 311 | shopid: 0, |
| 296 | payCate: 2020, | 312 | payCate: 2020, |
| 297 | payMoney: Number(this.skuInfo.real_price) * this.count * 100, | 313 | payMoney: Number(this.skuInfo.real_price) * this.count * 100, |
| 298 | payWoodId: `fcdj-${uid}-${keyName}`, | 314 | payWoodId: `fcdj-${uid}-${keyName}`, |
| 299 | payWoodDesc: '在【非常戴镜】的微信付款凭证', | 315 | payWoodDesc: '在【非常戴镜】的微信付款凭证', |
| 300 | nonceStr, | 316 | nonceStr, |
| 301 | signType: 'MD5', | 317 | signType: 'MD5', |
| 302 | app_uid: 2020, | 318 | app_uid: 2020, |
| 303 | timeStamp, | 319 | timeStamp, |
| 304 | keyname: keyName, | 320 | keyname: keyName, |
| 305 | billInfo: JSON.stringify(data), | 321 | billInfo: JSON.stringify(data), |
| 306 | } | 322 | } |
| 307 | // 请求后台支付接口 | 323 | // 请求后台支付接口 |
| 308 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | 324 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { |
| 309 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | 325 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { |
| 310 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | 326 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` |
| 311 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | 327 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' |
| 312 | 328 | ||
| 313 | // 微信支付接口 | 329 | // 微信支付接口 |
| 314 | uni.requestPayment({ | 330 | uni.requestPayment({ |
| 315 | appId: data.appid, | 331 | appId: data.appid, |
| 316 | timeStamp, | 332 | timeStamp, |
| 317 | nonceStr, | 333 | nonceStr, |
| 318 | total_fee: Number(this.skuInfo.real_price) * this.count * 100, | 334 | total_fee: Number(this.skuInfo.real_price) * this.count * 100, |
| 319 | package: `prepay_id=${data.prepay_id}`, | 335 | package: `prepay_id=${data.prepay_id}`, |
| 320 | signType: 'MD5', | 336 | signType: 'MD5', |
| 321 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | 337 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), |
| 322 | success: (res) => { | 338 | success: (res) => { |
| 323 | // 支付成功 | 339 | // 支付成功 |
| 324 | uni.showModal({ | 340 | uni.showModal({ |
| 325 | content: '支付成功', | 341 | content: '支付成功', |
| 326 | showCancel: false, | 342 | showCancel: false, |
| 327 | }) | 343 | }) |
| 328 | // 跳转订单详情页->状态 待收货 | 344 | // 跳转订单详情页->状态 待收货 |
| 329 | uni.reLaunch({ | 345 | uni.reLaunch({ |
| 330 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&state=1&isPay=1`, | 346 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&state=1&isPay=1`, |
| 331 | }) | 347 | }) |
| 332 | }, | 348 | }, |
| 333 | fail: (res) => { | 349 | fail: (res) => { |
| 334 | // 支付失败 | 350 | // 支付失败 |
| 335 | uni.showModal({ | 351 | uni.showModal({ |
| 336 | content: '支付失败', | 352 | content: '支付失败', |
| 337 | showCancel: false, | 353 | showCancel: false, |
| 338 | }) | 354 | }) |
| 339 | // 跳转订单详情页->状态 待付款 | 355 | // 跳转订单详情页->状态 待付款 |
| 340 | uni.reLaunch({ | 356 | uni.reLaunch({ |
| 341 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&state=0&isPay=1`, | 357 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&state=0&isPay=1`, |
| 342 | }) | 358 | }) |
| 343 | }, | 359 | }, |
| 344 | complete: () => { | 360 | complete: () => { |
| 345 | uni.hideLoading() | 361 | uni.hideLoading() |
| 346 | }, | 362 | }, |
| 347 | }) | 363 | }) |
| 348 | } else { | 364 | } else { |
| 349 | uni.showModal({ | 365 | uni.showModal({ |
| 350 | content: '支付失败', | 366 | content: '支付失败', |
| 351 | showCancel: false, | 367 | showCancel: false, |
| 352 | }) | 368 | }) |
| 353 | console.log('支付失败') | 369 | console.log('支付失败') |
| 354 | uni.hideLoading() | 370 | uni.hideLoading() |
| 355 | } | 371 | } |
| 356 | }) | 372 | }) |
| 357 | }, | 373 | }, |
| 358 | }, | 374 | }, |
| 359 | } | 375 | } |
| 360 | </script> | 376 | </script> |
| 361 | 377 | ||
| 362 | <style lang="scss"> | 378 | <style lang="scss"> |
| 363 | .wrap { | 379 | .wrap { |
| 364 | height: 100vh; | 380 | height: 100vh; |
| 365 | background-color: #f2f2f2; | 381 | background-color: #f2f2f2; |
| 366 | font-family: PingFangSC-Regular; | 382 | font-family: PingFangSC-Regular; |
| 367 | letter-spacing: -0.23px; | 383 | letter-spacing: -0.23px; |
| 368 | position: absolute; | 384 | position: absolute; |
| 369 | } | 385 | } |
| 370 | .addAddress { | 386 | .addAddress { |
| 371 | background-color: #ffffff; | 387 | background-color: #ffffff; |
| 372 | box-sizing: border-box; | 388 | box-sizing: border-box; |
| 373 | height: 124rpx; | 389 | height: 124rpx; |
| 374 | width: 100%; | 390 | width: 100%; |
| 375 | display: flex; | 391 | display: flex; |
| 376 | align-items: center; | 392 | align-items: center; |
| 377 | padding: 0 40rpx; | 393 | padding: 0 40rpx; |
| 378 | .addIcon { | 394 | .addIcon { |
| 379 | background-color: #f2f2f2; | 395 | background-color: #f2f2f2; |
| 380 | height: 56rpx; | 396 | height: 56rpx; |
| 381 | width: 60rpx; | 397 | width: 60rpx; |
| 382 | border-radius: 4rpx; | 398 | border-radius: 4rpx; |
| 383 | display: flex; | 399 | display: flex; |
| 384 | justify-content: center; | 400 | justify-content: center; |
| 385 | align-items: center; | 401 | align-items: center; |
| 386 | margin-right: 40rpx; | 402 | margin-right: 40rpx; |
| 387 | } | 403 | } |
| 388 | image { | 404 | image { |
| 389 | height: 28rpx; | 405 | height: 28rpx; |
| 390 | width: 30rpx; | 406 | width: 30rpx; |
| 391 | } | 407 | } |
| 392 | .addressText { | 408 | .addressText { |
| 393 | font-size: 28rpx; | 409 | font-size: 28rpx; |
| 394 | color: #333333; | 410 | color: #333333; |
| 395 | margin-right: 364rpx; | 411 | margin-right: 364rpx; |
| 396 | } | 412 | } |
| 397 | } | 413 | } |
| 398 | .content { | 414 | .content { |
| 399 | background-color: #f2f2f2; | 415 | background-color: #f2f2f2; |
| 400 | width: 100%; | 416 | width: 100%; |
| 401 | display: flex; | 417 | display: flex; |
| 402 | flex-direction: column; | 418 | flex-direction: column; |
| 403 | justify-content: center; | 419 | justify-content: center; |
| 404 | align-items: center; | 420 | align-items: center; |
| 405 | padding: 40rpx; | 421 | padding: 40rpx; |
| 406 | box-sizing: border-box; | 422 | box-sizing: border-box; |
| 407 | .orderInfo { | 423 | .orderInfo { |
| 408 | width: 670rpx; | 424 | width: 670rpx; |
| 409 | min-height: 488rpx; | 425 | min-height: 488rpx; |
| 410 | background-color: #ffffff; | 426 | background-color: #ffffff; |
| 411 | border-radius: 20rpx; | 427 | border-radius: 20rpx; |
| 412 | box-sizing: border-box; | 428 | box-sizing: border-box; |
| 413 | padding: 0 40rpx 40rpx 40rpx; | 429 | padding: 0 40rpx 40rpx 40rpx; |
| 414 | .title { | 430 | .title { |
| 415 | display: flex; | 431 | display: flex; |
| 416 | align-items: center; | 432 | align-items: center; |
| 417 | font-size: 28rpx; | 433 | font-size: 28rpx; |
| 418 | color: #333333; | 434 | color: #333333; |
| 419 | height: 60rpx; | 435 | height: 60rpx; |
| 420 | line-height: 40rpx; | 436 | line-height: 40rpx; |
| 421 | padding: 10rpx 10rpx 10rpx 0rpx; | 437 | padding: 10rpx 10rpx 10rpx 0rpx; |
| 422 | image { | 438 | image { |
| 423 | margin-right: 20rpx; | 439 | margin-right: 20rpx; |
| 424 | } | 440 | } |
| 425 | } | 441 | } |
| 426 | .infoBox { | 442 | .infoBox { |
| 427 | margin-top: 42rpx; | 443 | margin-top: 42rpx; |
| 428 | .infoTop { | 444 | .infoTop { |
| 429 | display: flex; | 445 | display: flex; |
| 430 | flex-direction: row; | 446 | flex-direction: row; |
| 431 | image { | 447 | image { |
| 432 | height: 188rpx; | 448 | height: 188rpx; |
| 433 | width: 188rpx; | 449 | width: 188rpx; |
| 434 | margin-right: 24rpx; | 450 | margin-right: 24rpx; |
| 435 | } | 451 | } |
| 436 | .infoRight { | 452 | .infoRight { |
| 437 | width: 374rpx; | 453 | width: 374rpx; |
| 438 | display: flex; | 454 | display: flex; |
| 439 | flex-direction: column; | 455 | flex-direction: column; |
| 440 | align-items: flex-start; | 456 | align-items: flex-start; |
| 441 | justify-content: space-between; | 457 | justify-content: space-between; |
| 442 | .goodName { | 458 | .goodName { |
| 443 | font-size: 28rpx; | 459 | font-size: 28rpx; |
| 444 | color: #333333; | 460 | color: #333333; |
| 445 | } | 461 | } |
| 446 | .remarks { | 462 | .remarks { |
| 447 | font-size: 20rpx; | 463 | font-size: 20rpx; |
| 448 | color: #999999; | 464 | color: #999999; |
| 449 | } | 465 | } |
| 450 | .priceBox { | 466 | .priceBox { |
| 451 | display: flex; | 467 | display: flex; |
| 452 | justify-content: space-between; | 468 | justify-content: space-between; |
| 453 | align-items: center; | 469 | align-items: center; |
| 454 | width: 100%; | 470 | width: 100%; |
| 455 | .price { | 471 | .price { |
| 456 | color: #ff6b4a; | 472 | color: #ff6b4a; |
| 457 | font-size: 28rpx; | 473 | font-size: 28rpx; |
| 458 | } | 474 | } |
| 459 | .originCost { | 475 | .originCost { |
| 460 | text-decoration: line-through; | 476 | text-decoration: line-through; |
| 461 | color: #999999; | 477 | color: #999999; |
| 462 | font-size: 20rpx; | 478 | font-size: 20rpx; |
| 463 | } | 479 | } |
| 464 | .counter { | 480 | .counter { |
| 465 | display: flex; | 481 | display: flex; |
| 466 | flex-direction: row; | 482 | flex-direction: row; |
| 467 | justify-content: space-between; | 483 | justify-content: space-between; |
| 468 | font-size: 28rpx; | 484 | font-size: 28rpx; |
| 469 | color: #333333; | 485 | color: #333333; |
| 470 | width: 122rpx; | 486 | width: 122rpx; |
| 471 | .btn { | 487 | .btn { |
| 472 | display: flex; | 488 | display: flex; |
| 473 | justify-content: center; | 489 | justify-content: center; |
| 474 | line-height: 32rpx; | 490 | line-height: 32rpx; |
| 475 | height: 32rpx; | 491 | height: 32rpx; |
| 476 | width: 32rpx; | 492 | width: 32rpx; |
| 477 | background-color: #f2f2f2; | 493 | background-color: #f2f2f2; |
| 478 | color: #cfcfcf; | 494 | color: #cfcfcf; |
| 479 | } | 495 | } |
| 480 | } | 496 | } |
| 481 | } | 497 | } |
| 482 | } | 498 | } |
| 483 | } | 499 | } |
| 484 | .infoBottom { | 500 | .infoBottom { |
| 485 | display: flex; | 501 | display: flex; |
| 486 | flex-direction: column; | 502 | flex-direction: column; |
| 487 | justify-content: flex-start; | 503 | justify-content: flex-start; |
| 488 | font-size: 24rpx; | 504 | font-size: 24rpx; |
| 489 | color: #333333; | 505 | color: #333333; |
| 490 | text { | 506 | text { |
| 491 | color: #999999; | 507 | color: #999999; |
| 492 | margin-left: 20rpx; | 508 | margin-left: 20rpx; |
| 493 | } | 509 | } |
| 494 | 510 | ||
| 495 | .norm { | 511 | .norm { |
| 496 | margin-top: 28rpx; | 512 | margin-top: 28rpx; |
| 497 | } | 513 | } |
| 498 | .shippingMethod { | 514 | .shippingMethod { |
| 499 | margin-top: 12rpx; | 515 | margin-top: 12rpx; |
| 500 | } | 516 | } |
| 501 | .message { | 517 | .message { |
| 502 | display: flex; | 518 | display: flex; |
| 503 | flex-direction: row; | 519 | flex-direction: row; |
| 504 | align-items: center; | 520 | align-items: center; |
| 505 | margin-top: 18rpx; | 521 | margin-top: 18rpx; |
| 506 | input { | 522 | input { |
| 507 | margin-left: 20rpx; | 523 | margin-left: 20rpx; |
| 508 | width: 75%; | 524 | width: 75%; |
| 509 | } | 525 | } |
| 510 | } | 526 | } |
| 511 | } | 527 | } |
| 512 | } | 528 | } |
| 513 | } | 529 | } |
| 514 | .payWay { | 530 | .payWay { |
| 515 | height: 464rpx; | 531 | height: 464rpx; |
| 516 | width: 670rpx; | 532 | width: 670rpx; |
| 517 | background-color: #ffffff; | 533 | background-color: #ffffff; |
| 518 | color: #333333; | 534 | color: #333333; |
| 519 | font-size: 24rpx; | 535 | font-size: 24rpx; |
| 520 | border-radius: 20rpx; | 536 | border-radius: 20rpx; |
| 521 | box-sizing: border-box; | 537 | box-sizing: border-box; |
| 522 | padding: 0 52rpx 0rpx 40rpx; | 538 | padding: 0 52rpx 0rpx 40rpx; |
| 523 | margin-top: 20rpx; | 539 | margin-top: 20rpx; |
| 524 | display: flex; | 540 | display: flex; |
| 525 | flex-direction: column; | 541 | flex-direction: column; |
| 526 | justify-content: center; | 542 | justify-content: center; |
| 527 | align-items: flex-start; | 543 | align-items: flex-start; |
| 528 | .item { | 544 | .item { |
| 529 | display: flex; | 545 | display: flex; |
| 530 | flex-direction: row; | 546 | flex-direction: row; |
| 531 | justify-content: space-between; | 547 | justify-content: space-between; |
| 532 | align-items: center; | 548 | align-items: center; |
| 533 | width: 100%; | 549 | width: 100%; |
| 534 | height: 115rpx; | 550 | height: 115rpx; |
| 535 | .itemRight { | 551 | .itemRight { |
| 536 | display: flex; | 552 | display: flex; |
| 537 | flex-direction: row; | 553 | flex-direction: row; |
| 538 | justify-content: space-between; | 554 | justify-content: space-between; |
| 539 | align-items: center; | 555 | align-items: center; |
| 540 | image { | 556 | image { |
| 541 | height: 24rpx; | 557 | height: 24rpx; |
| 542 | width: 12rpx; | 558 | width: 12rpx; |
| 543 | } | 559 | } |
| 544 | .rightText { | 560 | .rightText { |
| 545 | margin-right: 20rpx; | 561 | margin-right: 20rpx; |
| 546 | text-align: right; | 562 | text-align: right; |
| 547 | .choosePayWay { | 563 | .choosePayWay { |
| 548 | display: flex; | 564 | display: flex; |
| 549 | align-items: center; | 565 | align-items: center; |
| 550 | text { | 566 | text { |
| 551 | color: #333333; | 567 | color: #333333; |
| 552 | } | 568 | } |
| 553 | image { | 569 | image { |
| 554 | height: 36rpx; | 570 | height: 36rpx; |
| 555 | width: 40rpx; | 571 | width: 40rpx; |
| 556 | margin-right: 8px; | 572 | margin-right: 8px; |
| 557 | } | 573 | } |
| 558 | } | 574 | } |
| 559 | .randomSubstraction { | 575 | .randomSubstraction { |
| 560 | color: #ff6b4a; | 576 | color: #ff6b4a; |
| 561 | } | 577 | } |
| 562 | .preferentialWay { | 578 | .preferentialWay { |
| 563 | color: #999999; | 579 | color: #999999; |
| 564 | } | 580 | } |
| 565 | } | 581 | } |
| 566 | .freight, | 582 | .freight, |
| 567 | .total { | 583 | .total { |
| 568 | margin-right: 32rpx; | 584 | margin-right: 32rpx; |
| 569 | } | 585 | } |
| 570 | text { | 586 | text { |
| 571 | color: #ff6b4a; | 587 | color: #ff6b4a; |
| 572 | } | 588 | } |
| 573 | } | 589 | } |
| 574 | } | 590 | } |
| 575 | } | 591 | } |
| 576 | // .checkBox { | 592 | // .checkBox { |
| 577 | // height: 58rpx; | 593 | // height: 58rpx; |
| 578 | // line-height: 58rpx; | 594 | // line-height: 58rpx; |
| 579 | // width: 100%; | 595 | // width: 100%; |
| 580 | // margin-top: 36rpx; | 596 | // margin-top: 36rpx; |
| 581 | // margin-left: 40rpx; | 597 | // margin-left: 40rpx; |
| 582 | // font-size: 12px; | 598 | // font-size: 12px; |
| 583 | // color: #999999; | 599 | // color: #999999; |
| 584 | // } | 600 | // } |
| 585 | } | 601 | } |
| 586 | .footer { | 602 | .footer { |
| 587 | height: 112rpx; | 603 | height: 112rpx; |
| 588 | width: 100%; | 604 | width: 100%; |
| 589 | background-color: #fff; | 605 | background-color: #fff; |
| 590 | font-size: 16px; | 606 | font-size: 16px; |
| 591 | display: flex; | 607 | display: flex; |
| 592 | justify-content: space-between; | 608 | justify-content: space-between; |
| 593 | align-items: center; | 609 | align-items: center; |
| 594 | position: fixed; | 610 | position: fixed; |
| 595 | bottom: 0; | 611 | bottom: 0; |
| 596 | .footerLeft { | 612 | .footerLeft { |
| 597 | display: flex; | 613 | display: flex; |
| 598 | justify-content: center; | 614 | justify-content: center; |
| 599 | align-items: center; | 615 | align-items: center; |
| 600 | width: 50%; | 616 | width: 50%; |
| 601 | color: #333333; | 617 | color: #333333; |
| 602 | text { | 618 | text { |
| 603 | color: #ff6b4a; | 619 | color: #ff6b4a; |
| 604 | } | 620 | } |
| 605 | } | 621 | } |
| 606 | .footerRight { | 622 | .footerRight { |
| 607 | display: flex; | 623 | display: flex; |
| 608 | justify-content: flex-end; | 624 | justify-content: flex-end; |
| 609 | align-items: center; | 625 | align-items: center; |
| 610 | width: 50%; | 626 | width: 50%; |
| 611 | margin-right: 26rpx; | 627 | margin-right: 26rpx; |
| 612 | .paybtn { | 628 | .paybtn { |
| 613 | display: flex; | 629 | display: flex; |
| 614 | justify-content: center; | 630 | justify-content: center; |
| 615 | align-items: center; | 631 | align-items: center; |
| 616 | background: #ff6b4a; | 632 | background: #ff6b4a; |
| 617 | border-radius: 20px; | 633 | border-radius: 20px; |
| 618 | border-radius: 20px; | 634 | border-radius: 20px; |
| 619 | color: #ffffff; | 635 | color: #ffffff; |
| 620 | width: 204rpx; | 636 | width: 204rpx; |
| 621 | height: 80rpx; | 637 | height: 80rpx; |
| 622 | } | 638 | } |
| 623 | } | 639 | } |
| 624 | } | 640 | } |
| 625 | // 地址信息样式 | 641 | // 地址信息样式 |
| 626 | .order-user { | 642 | .order-user { |
| 627 | width: 670rpx; | 643 | width: 670rpx; |
| 628 | height: 228rpx; | 644 | height: 228rpx; |
| 629 | background: #ffffff; | 645 | background: #ffffff; |
| 630 | border-radius: 14rpx; | 646 | border-radius: 14rpx; |
| 631 | margin: 0 auto; | 647 | margin: 0 auto; |
| 632 | margin-top: 20rpx; | 648 | margin-top: 20rpx; |
| 633 | position: relative; | 649 | position: relative; |
| 634 | .order-user-head { | 650 | .order-user-head { |
| 635 | display: flex; | 651 | display: flex; |
| 636 | height: 108rpx; | 652 | height: 108rpx; |
| 637 | width: 100%; | 653 | width: 100%; |
| 638 | align-items: center; | 654 | align-items: center; |
| 639 | padding-left: 126rpx; | 655 | padding-left: 126rpx; |
| 640 | box-sizing: border-box; | 656 | box-sizing: border-box; |
| 641 | .name { | 657 | .name { |
| 642 | display: flex; | 658 | display: flex; |
| 643 | justify-content: space-between; | 659 | justify-content: space-between; |
| 644 | font-size: 14px; | 660 | font-size: 14px; |
| 645 | color: #333333; | 661 | color: #333333; |
| 646 | letter-spacing: -0.26px; | 662 | letter-spacing: -0.26px; |
| 647 | margin-right: 20rpx; | 663 | margin-right: 20rpx; |
| 648 | .default { | 664 | .default { |
| 649 | height: 40rpx; | 665 | height: 40rpx; |
| 650 | width: 80rpx; | 666 | width: 80rpx; |
| 651 | background-color: #4a90e2; | 667 | background-color: #4a90e2; |
| 652 | border-radius: 13px; | 668 | border-radius: 13px; |
| 653 | border-radius: 13px; | 669 | border-radius: 13px; |
| 654 | text-align: center; | 670 | text-align: center; |
| 655 | margin-right: 20rpx; | 671 | margin-right: 20rpx; |
| 656 | text { | 672 | text { |
| 657 | display: flex; | 673 | display: flex; |
| 658 | justify-content: center; | 674 | justify-content: center; |
| 659 | align-items: center; | 675 | align-items: center; |
| 660 | font-size: 12px; | 676 | font-size: 12px; |
| 661 | color: #ffffff; | 677 | color: #ffffff; |
| 662 | letter-spacing: -0.23px; | 678 | letter-spacing: -0.23px; |
| 663 | } | 679 | } |
| 664 | } | 680 | } |
| 665 | } | 681 | } |
| 666 | .mobile { | 682 | .mobile { |
| 667 | font-size: 14px; | 683 | font-size: 14px; |
| 668 | color: #999999; | 684 | color: #999999; |
| 669 | letter-spacing: -0.26px; | 685 | letter-spacing: -0.26px; |
| 670 | } | 686 | } |
| 671 | } | 687 | } |
| 672 | .order-user-body { | 688 | .order-user-body { |
| 673 | display: flex; | 689 | display: flex; |
| 674 | width: 100%; | 690 | width: 100%; |
| 675 | image { | 691 | image { |
| 676 | width: 24px; | 692 | width: 24px; |
| 677 | height: 28px; | 693 | height: 28px; |
| 678 | margin: 12rpx 32rpx 0 40rpx; | 694 | margin: 12rpx 32rpx 0 40rpx; |
| 679 | } | 695 | } |
| 680 | .address { | 696 | .address { |
| 681 | font-weight: bold; | 697 | font-weight: bold; |
| 682 | font-size: 14px; | 698 | font-size: 14px; |
| 683 | color: #333333; | 699 | color: #333333; |
| 684 | letter-spacing: -0.26px; | 700 | letter-spacing: -0.26px; |
| 685 | } | 701 | } |
| 686 | } | 702 | } |
| 687 | .arrow { | 703 | .arrow { |
| 688 | width: 12px; | 704 | width: 12px; |
| 689 | height: 12px; | 705 | height: 12px; |
| 690 | position: absolute; | 706 | position: absolute; |
| 691 | right: 40rpx; | 707 | right: 40rpx; |
| 692 | bottom: 104rpx; | 708 | bottom: 104rpx; |
| 693 | } | 709 | } |
| 694 | } | 710 | } |
| 695 | .last_zhanwei{ | 711 | .last_zhanwei{ |
| 696 | background: #f2f2f2; | 712 | background: #f2f2f2; |
| 697 | height: 60px; | 713 | height: 60px; |
| 698 | } | 714 | } |
| 699 | </style> | 715 | </style> |
| 700 | 716 |
src/pages/frameDetail/components/BottomSheet.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="content"> | 2 | <view class="content"> |
| 3 | <view class="sheet" :class="{sheetShow:isShowBottom,sheeHide:!isShowBottom}" @touchmove.stop.prevent="moveHandle" @click="closeSheet()"> | 3 | <view class="sheet" :class="{sheetShow:isShowBottom,sheeHide:!isShowBottom}" @touchmove.stop.prevent="moveHandle" @click="closeSheet()"> |
| 4 | <scroll-view scroll-y="true" class="sheetView" :class="{sheetView_active:isShowBottom}" @click.stop="stopEvent()" > | 4 | <scroll-view scroll-y="true" class="sheetView" :class="{sheetView_active:isShowBottom}" @click.stop="stopEvent()" > |
| 5 | <view class="content"> | 5 | <view class="content"> |
| 6 | <view class="goodInfo"> | 6 | <view class="goodInfo"> |
| 7 | <view class="imageWrap"> | 7 | <view class="imageWrap"> |
| 8 | <image | 8 | <image |
| 9 | :src="goodInfo.img_index_url" | 9 | :src="goodInfo.img_index_url" |
| 10 | mode="aspectFill" | 10 | mode="aspectFill" |
| 11 | style="width: 188rpx;height: 168rpx;" | 11 | style="width: 188rpx;height: 168rpx;" |
| 12 | ></image> | 12 | ></image> |
| 13 | </view> | 13 | </view> |
| 14 | <view class="infoRight"> | 14 | <view class="infoRight"> |
| 15 | <text class="goodName">{{goodInfo.p_name}}</text> | 15 | <text class="goodName">{{goodInfo.p_name}}</text> |
| 16 | <text class="remarks">支持7天无理由退货 顺丰发货</text> | 16 | <text class="remarks">支持7天无理由退货 顺丰发货</text> |
| 17 | <view class="priceBox"> | 17 | <view class="priceBox"> |
| 18 | <view class="price">¥{{goodInfo.priceArea.Min_Price || '暂无'}}</view> | 18 | <view class="price">¥{{goodInfo.priceArea.Min_Price || '暂无'}}</view> |
| 19 | <text>(限购{{maxCount}}副)</text> | 19 | <text>(限购{{maxCount}}副)</text> |
| 20 | <view class="counter"> | 20 | <view class="counter"> |
| 21 | <view | 21 | <view |
| 22 | class="btn" | 22 | class="btn" |
| 23 | disabled="this.addDisabled" | 23 | disabled="this.addDisabled" |
| 24 | type="default" | 24 | type="default" |
| 25 | @click="counter(false)" | 25 | @click="counter(false)" |
| 26 | >-</view> | 26 | >-</view> |
| 27 | <text>{{count}}</text> | 27 | <text>{{count}}</text> |
| 28 | <view | 28 | <view |
| 29 | class="btn" | 29 | class="btn" |
| 30 | disabled="this.desDisabled" | 30 | disabled="this.desDisabled" |
| 31 | type="default" | 31 | type="default" |
| 32 | @click="counter(true)" | 32 | @click="counter(true)" |
| 33 | >+</view> | 33 | >+</view> |
| 34 | </view> | 34 | </view> |
| 35 | </view> | 35 | </view> |
| 36 | </view> | 36 | </view> |
| 37 | </view> | 37 | </view> |
| 38 | <view class="peopleChoose"> | 38 | <view class="peopleChoose"> |
| 39 | <view class="title">选择使用人</view> | 39 | <view class="title">选择使用人</view> |
| 40 | <view class="loveList"> | 40 | <view class="loveList"> |
| 41 | <view class="peopleName" v-for="(item,index) in loveList" :key='index' :class="{ active2: loveCurrent === index }" | 41 | <view class="peopleName" v-for="(item,index) in loveList" :key='index' :class="{ active2: loveCurrent === index }" |
| 42 | @click="onClickLoveItem(index,item.name)"> | 42 | @click="onClickLoveItem(index,item.name)"> |
| 43 | {{item.name}} | 43 | {{item.name}} |
| 44 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | </view> | 46 | </view> |
| 47 | <view class="goods-data"> | 47 | <view class="goods-data"> |
| 48 | <view class="opCollapse"> | 48 | <view class="opCollapse"> |
| 49 | <view class="body"> | 49 | <view class="body"> |
| 50 | <template v-if="opIsOpen"> | 50 | <template v-if="opIsOpen"> |
| 51 | <view class="goods-form"> | 51 | <view class="goods-form"> |
| 52 | <view class="p1"> | 52 | <view class="p1"> |
| 53 | <image class="image2" src="../../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> | 53 | <image class="image2" src="../../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> |
| 54 | 填写验光数据 | 54 | 填写验光数据 |
| 55 | </view> | 55 | </view> |
| 56 | <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | 56 | <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> |
| 57 | <view class="picker"> | 57 | <view class="picker"> |
| 58 | <view class="picker-choice"> | 58 | <view class="picker-choice"> |
| 59 | <view class="choice-left"> | 59 | <view class="choice-left"> |
| 60 | <text class="pd">验光单取名:</text> | 60 | <text class="pd">验光单取名:</text> |
| 61 | </view> | 61 | </view> |
| 62 | <input type="text" @blur="handleInput" class="input" | 62 | <input type="text" @blur="handleInput" class="input" |
| 63 | placeholder="请输入名称" maxlength="20" :value="name" /> | 63 | placeholder="请输入名称" maxlength="20" :value="name" /> |
| 64 | </view> | 64 | </view> |
| 65 | </view> | 65 | </view> |
| 66 | <view class="picker" > | 66 | <view class="picker" > |
| 67 | <view class="picker-choice"> | 67 | <view class="picker-choice"> |
| 68 | <view class="choice-left"> | 68 | <view class="choice-left"> |
| 69 | <text class="p11">{{pickerInfoList[0].nameC}}</text> | 69 | <text class="p11">{{pickerInfoList[0].nameC}}</text> |
| 70 | <text class="p12">{{pickerInfoList[0].nameE}}</text> | 70 | <text class="p12">{{pickerInfoList[0].nameE}}</text> |
| 71 | </view> | 71 | </view> |
| 72 | <text class="p13">左 (OD)</text> | 72 | <text class="p13">左 (OD)</text> |
| 73 | <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> | 73 | <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> |
| 74 | <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> | 74 | <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> |
| 75 | <view class="p14"> | 75 | <view class="p14"> |
| 76 | {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} | 76 | {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} |
| 77 | <image src="../../../static/detail-tabicon.png" ></image> | 77 | <image src="../../../static/detail-tabicon.png" ></image> |
| 78 | </view> | 78 | </view> |
| 79 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> | 79 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> |
| 80 | </picker> | 80 | </picker> |
| 81 | <text class="p13">右 (OS)</text> | 81 | <text class="p13">右 (OS)</text> |
| 82 | <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> | 82 | <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> |
| 83 | <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> | 83 | <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> |
| 84 | <view class="p14"> | 84 | <view class="p14"> |
| 85 | {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} | 85 | {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} |
| 86 | <image src="../../../static/detail-tabicon.png" ></image> | 86 | <image src="../../../static/detail-tabicon.png" ></image> |
| 87 | </view> | 87 | </view> |
| 88 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> | 88 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> |
| 89 | </picker> | 89 | </picker> |
| 90 | </view> | 90 | </view> |
| 91 | </view> | 91 | </view> |
| 92 | <view class="picker" > | 92 | <view class="picker" > |
| 93 | <view class="picker-choice"> | 93 | <view class="picker-choice"> |
| 94 | <view class="choice-left"> | 94 | <view class="choice-left"> |
| 95 | <text class="p11">{{pickerInfoList[1].nameC}}</text> | 95 | <text class="p11">{{pickerInfoList[1].nameC}}</text> |
| 96 | <text class="p12">{{pickerInfoList[1].nameE}}</text> | 96 | <text class="p12">{{pickerInfoList[1].nameE}}</text> |
| 97 | </view> | 97 | </view> |
| 98 | <text class="p13">左 (OD)</text> | 98 | <text class="p13">左 (OD)</text> |
| 99 | <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> | 99 | <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> |
| 100 | <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> | 100 | <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> |
| 101 | <view class="p14"> | 101 | <view class="p14"> |
| 102 | {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} | 102 | {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} |
| 103 | <image src="../../../static/detail-tabicon.png" ></image> | 103 | <image src="../../../static/detail-tabicon.png" ></image> |
| 104 | </view> | 104 | </view> |
| 105 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> | 105 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> |
| 106 | </picker> | 106 | </picker> |
| 107 | <text class="p13">右 (OS)</text> | 107 | <text class="p13">右 (OS)</text> |
| 108 | <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> | 108 | <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> |
| 109 | <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> | 109 | <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> |
| 110 | <view class="p14"> | 110 | <view class="p14"> |
| 111 | {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} | 111 | {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} |
| 112 | <image src="../../../static/detail-tabicon.png" ></image> | 112 | <image src="../../../static/detail-tabicon.png" ></image> |
| 113 | </view> | 113 | </view> |
| 114 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> | 114 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> |
| 115 | </picker> | 115 | </picker> |
| 116 | </view> | 116 | </view> |
| 117 | </view> | 117 | </view> |
| 118 | <view class="picker" > | 118 | <view class="picker" > |
| 119 | <view class="picker-choice"> | 119 | <view class="picker-choice"> |
| 120 | <view class="choice-left"> | 120 | <view class="choice-left"> |
| 121 | <text class="p11">{{pickerInfoList[2].nameC}}</text> | 121 | <text class="p11">{{pickerInfoList[2].nameC}}</text> |
| 122 | <text class="p12">{{pickerInfoList[2].nameE}}</text> | 122 | <text class="p12">{{pickerInfoList[2].nameE}}</text> |
| 123 | </view> | 123 | </view> |
| 124 | <text class="p13">左 (OD)</text> | 124 | <text class="p13">左 (OD)</text> |
| 125 | <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> | 125 | <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> |
| 126 | <view class="p14"> | 126 | <view class="p14"> |
| 127 | {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} | 127 | {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} |
| 128 | <image src="../../../static/detail-tabicon.png" ></image> | 128 | <image src="../../../static/detail-tabicon.png" ></image> |
| 129 | </view> | 129 | </view> |
| 130 | </picker> | 130 | </picker> |
| 131 | <text class="p13">右 (OS)</text> | 131 | <text class="p13">右 (OS)</text> |
| 132 | <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> | 132 | <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> |
| 133 | <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> | 133 | <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> |
| 134 | <view class="p14"> | 134 | <view class="p14"> |
| 135 | {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} | 135 | {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} |
| 136 | <image src="../../../static/detail-tabicon.png" ></image> | 136 | <image src="../../../static/detail-tabicon.png" ></image> |
| 137 | </view> | 137 | </view> |
| 138 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> | 138 | <!-- <image src="../../../static/detail-tabicon.png" ></image> --> |
| 139 | </picker> | 139 | </picker> |
| 140 | </view> | 140 | </view> |
| 141 | </view> | 141 | </view> |
| 142 | <view class="picker"> | 142 | <view class="picker"> |
| 143 | <view class="picker-choice"> | 143 | <view class="picker-choice"> |
| 144 | <view class="choice-left"> | 144 | <view class="choice-left"> |
| 145 | <text class="pd">瞳距:</text> | 145 | <text class="pd">瞳距:</text> |
| 146 | </view> | 146 | </view> |
| 147 | <input type="digit" @change="handleInputPd" class="input" | 147 | <input type="digit" @change="handleInputPd" class="input" |
| 148 | placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> | 148 | placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> |
| 149 | </view> | 149 | </view> |
| 150 | </view> | 150 | </view> |
| 151 | <view class="picker" > | 151 | <view class="picker" > |
| 152 | <view class="picker-choice"> | 152 | <view class="picker-choice"> |
| 153 | <view class="choice-left"> | 153 | <view class="choice-left"> |
| 154 | <text class="p11">{{pickerInfoList[3].nameC}}</text> | 154 | <text class="p11">{{pickerInfoList[3].nameC}}</text> |
| 155 | </view> | 155 | </view> |
| 156 | <text class="p13-date">年 (Y)</text> | 156 | <text class="p13-date">年 (Y)</text> |
| 157 | <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> | 157 | <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> |
| 158 | <view class="p14" style="width: 30px;"> | 158 | <view class="p14" style="width: 30px;"> |
| 159 | {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} | 159 | {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} |
| 160 | <image src="../../../static/detail-tabicon.png" ></image> | 160 | <image src="../../../static/detail-tabicon.png" ></image> |
| 161 | </view> | 161 | </view> |
| 162 | </picker> | 162 | </picker> |
| 163 | <text class="p13-date">月 (M)</text> | 163 | <text class="p13-date">月 (M)</text> |
| 164 | <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> | 164 | <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> |
| 165 | <view class="p14" style="width: 30px;"> | 165 | <view class="p14" style="width: 30px;"> |
| 166 | {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} | 166 | {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} |
| 167 | <image src="../../../static/detail-tabicon.png" ></image> | 167 | <image src="../../../static/detail-tabicon.png" ></image> |
| 168 | </view> | 168 | </view> |
| 169 | </picker> | 169 | </picker> |
| 170 | <text class="p13-date">日 (D)</text> | 170 | <text class="p13-date">日 (D)</text> |
| 171 | <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> | 171 | <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> |
| 172 | <view class="p14" style="width: 30px;"> | 172 | <view class="p14" style="width: 30px;"> |
| 173 | {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} | 173 | {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} |
| 174 | <image src="../../../static/detail-tabicon.png" ></image> | 174 | <image src="../../../static/detail-tabicon.png" ></image> |
| 175 | </view> | 175 | </view> |
| 176 | </picker> | 176 | </picker> |
| 177 | </view> | 177 | </view> |
| 178 | </view> | 178 | </view> |
| 179 | <view class="confirm"> | 179 | <view class="confirm"> |
| 180 | <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> | 180 | <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> |
| 181 | <text>确认以上输入信息来源于我的验光数据!</text> | 181 | <text>确认以上输入信息来源于我的验光数据!</text> |
| 182 | </view> | 182 | </view> |
| 183 | </view> | 183 | </view> |
| 184 | </template> | 184 | </template> |
| 185 | <template v-else> | 185 | <template v-else> |
| 186 | <view | 186 | <view |
| 187 | v-for="item in pickerInfoList" | 187 | v-for="item in pickerInfoList" |
| 188 | :key="item.key" | 188 | :key="item.key" |
| 189 | class="bodyBox" | 189 | class="bodyBox" |
| 190 | > | 190 | > |
| 191 | <template v-if="item.nameC==='验光日期'"> | 191 | <template v-if="item.nameC==='验光日期'"> |
| 192 | <text class="names">{{item.nameC}}</text> | 192 | <text class="names">{{item.nameC}}</text> |
| 193 | <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> | 193 | <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> |
| 194 | <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> | 194 | <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> |
| 195 | <text>{{item.nameArray3[item.nameIndex2]}}日</text> | 195 | <text>{{item.nameArray3[item.nameIndex2]}}日</text> |
| 196 | </template> | 196 | </template> |
| 197 | <template v-else> | 197 | <template v-else> |
| 198 | <template v-if="item.nameC==='度数'"> | 198 | <template v-if="item.nameC==='度数'"> |
| 199 | <text style="display: inline;">*</text> | 199 | <text style="display: inline;">*</text> |
| 200 | </template> | 200 | </template> |
| 201 | 201 | ||
| 202 | <text class="names">{{item.nameC}}</text> | 202 | <text class="names">{{item.nameC}}</text> |
| 203 | <text style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> | 203 | <text style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> |
| 204 | <text>右 {{item.nameArray2[item.nameIndex2]}}</text> | 204 | <text>右 {{item.nameArray2[item.nameIndex2]}}</text> |
| 205 | </template> | 205 | </template> |
| 206 | </view> | 206 | </view> |
| 207 | </template> | 207 | </template> |
| 208 | </view> | 208 | </view> |
| 209 | </view> | 209 | </view> |
| 210 | </view> | 210 | </view> |
| 211 | <view class="choose"> | 211 | <view class="choose"> |
| 212 | <view | 212 | <view |
| 213 | class="chooseItem_1_content" | 213 | class="chooseItem_1_content" |
| 214 | v-for="(item,index) in attrList" | 214 | v-for="(item,index) in attrList" |
| 215 | :key="index" | 215 | :key="index" |
| 216 | > | 216 | > |
| 217 | <UniCollapse @change="changeShow(index)"> | 217 | <UniCollapse @change="changeShow(index)"> |
| 218 | <UniCollapseItem | 218 | <UniCollapseItem |
| 219 | :open="show[index]" | 219 | :open="show[index]" |
| 220 | :title="item.meta_name" | 220 | :title="item.meta_name" |
| 221 | showAnimation=false | 221 | showAnimation=false |
| 222 | > | 222 | > |
| 223 | <view class="chooseItem_1_content"> | 223 | <view class="chooseItem_1_content"> |
| 224 | <view class="itemsWrap"> | 224 | <view class="itemsWrap"> |
| 225 | <view | 225 | <view |
| 226 | class="item2" | 226 | class="item2" |
| 227 | v-for="(one,i) in item.attr" | 227 | v-for="(one,i) in item.attr" |
| 228 | :key="i" | 228 | :key="i" |
| 229 | :class="{ active2: current[index] === i }" | 229 | :class="{ active2: current[index] === i }" |
| 230 | @click="onClickItem(index, i)" | 230 | @click="onClickItem(index, i)" |
| 231 | >{{one.name}}</view> | 231 | >{{one.name}}</view> |
| 232 | </view> | 232 | </view> |
| 233 | </view> | 233 | </view> |
| 234 | </UniCollapseItem> | 234 | </UniCollapseItem> |
| 235 | </UniCollapse> | 235 | </UniCollapse> |
| 236 | <view | 236 | <view |
| 237 | class="chooseRes" | 237 | class="chooseRes" |
| 238 | v-show="!show[index]" | 238 | v-show="!show[index]" |
| 239 | >* {{attrList[index].attr[current[index]].name}}</view> | 239 | >* {{attrList[index].attr[current[index]].name}}</view> |
| 240 | </view> | 240 | </view> |
| 241 | <!-- <view class="chooseItem_1 chooseItem"> | ||
| 242 | <UniCollapse @change="change(1)"> | ||
| 243 | <UniCollapseItem | ||
| 244 | open=true | ||
| 245 | title="款式挑选" | ||
| 246 | showAnimation=false | ||
| 247 | > | ||
| 248 | <view | ||
| 249 | class="chooseRes" | ||
| 250 | v-show="show[1]" | ||
| 251 | >* {{chooseRes1}}</view> | ||
| 252 | <view class="chooseItem_1_content"> | ||
| 253 | <view class="itemsWrap"> | ||
| 254 | <view | ||
| 255 | class="item1" | ||
| 256 | v-for="(item,index) in chooseItem1" | ||
| 257 | :key="index" | ||
| 258 | :style="item.style" | ||
| 259 | :class="{ active1: current1 === index }" | ||
| 260 | @click="onClickItem1(index)" | ||
| 261 | ></view> | ||
| 262 | </view> | ||
| 263 | </view> | ||
| 264 | </UniCollapseItem> | ||
| 265 | </UniCollapse> | ||
| 266 | <view | ||
| 267 | class="chooseRes" | ||
| 268 | v-show="show[1]" | ||
| 269 | >* {{chooseRes1}}</view> | ||
| 270 | </view> | ||
| 271 | <view class="chooseItem_2 chooseItem "> | ||
| 272 | <UniCollapse @change="change(2)"> | ||
| 273 | <UniCollapseItem | ||
| 274 | open=true | ||
| 275 | title="直径" | ||
| 276 | showAnimation=false | ||
| 277 | > | ||
| 278 | <view class="chooseItem_1_content"> | ||
| 279 | <view class="itemsWrap"> | ||
| 280 | <view | ||
| 281 | class="item2" | ||
| 282 | v-for="(item,index) in chooseItem2" | ||
| 283 | :key="index" | ||
| 284 | :class="{ active2: current2 === index }" | ||
| 285 | @click="onClickItem2(index)" | ||
| 286 | >{{item.num}}</view> | ||
| 287 | </view> | ||
| 288 | </view> | ||
| 289 | </UniCollapseItem> | ||
| 290 | </UniCollapse> | ||
| 291 | <view | ||
| 292 | class="chooseRes" | ||
| 293 | v-show="show[2]" | ||
| 294 | >* {{chooseRes2}}</view> | ||
| 295 | </view> | ||
| 296 | <view class="chooseItem_3 chooseItem"> | ||
| 297 | <UniCollapse @change="change(3)"> | ||
| 298 | <UniCollapseItem | ||
| 299 | open=true | ||
| 300 | title="度数" | ||
| 301 | showAnimation=false | ||
| 302 | > | ||
| 303 | <view class="chooseItem_1_content"> | ||
| 304 | <view class="itemsWrap"> | ||
| 305 | <view | ||
| 306 | class="item2" | ||
| 307 | v-for="(item,index) in chooseItem3" | ||
| 308 | :key="index" | ||
| 309 | :class="{ active2: current3 === index }" | ||
| 310 | @click="onClickItem3(index)" | ||
| 311 | >{{item}}</view> | ||
| 312 | </view> | ||
| 313 | </view> | ||
| 314 | </UniCollapseItem> | ||
| 315 | </UniCollapse> | ||
| 316 | <view | ||
| 317 | class="chooseRes" | ||
| 318 | v-show="show[3]" | ||
| 319 | >* {{chooseRes3}}</view> | ||
| 320 | </view> --> | ||
| 321 | </view> | 241 | </view> |
| 322 | <view | 242 | <view |
| 323 | class="button" | 243 | class="button" |
| 324 | @click="toComfirmOrder" | 244 | @click="toComfirmOrder" |
| 325 | > | 245 | > |
| 326 | 立即结算 | 246 | 立即结算 |
| 327 | </view> | 247 | </view> |
| 328 | </view> | 248 | </view> |
| 329 | </scroll-view> | 249 | </scroll-view> |
| 330 | </view> | 250 | </view> |
| 331 | </view> | 251 | </view> |
| 332 | </template> | 252 | </template> |
| 333 | <script> | 253 | <script> |
| 334 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' | 254 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' |
| 335 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' | 255 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' |
| 336 | import store from '@/store' | 256 | import store from '@/store' |
| 337 | export default { | 257 | export default { |
| 338 | components: { | 258 | components: { |
| 339 | UniCollapse, | 259 | UniCollapse, |
| 340 | UniCollapseItem, | 260 | UniCollapseItem, |
| 341 | }, | 261 | }, |
| 342 | props: { | 262 | props: { |
| 343 | isShowBottom : Boolean, | 263 | isShowBottom : Boolean, |
| 344 | pid: Number, | 264 | pid: Number, |
| 345 | goodInfo:Object | 265 | goodInfo:Object |
| 346 | }, | 266 | }, |
| 347 | data() { | 267 | data() { |
| 348 | return { | 268 | return { |
| 349 | loveCurrent:Number, | 269 | loveCurrent:Number, |
| 350 | count: 1, | 270 | count: 1, |
| 351 | // pid: 0, | 271 | // pid: 0, |
| 352 | maxCount: 20, | 272 | maxCount: 20, |
| 353 | dataName: '', // 验光数据人员名称 | 273 | dataName: '', // 验光数据人员名称 |
| 354 | isDataName: false, // 是否是已存在的人员数据 | 274 | isDataName: false, // 是否是已存在的人员数据 |
| 355 | dataConfirm: false, // 已确认所输入验光数据 | 275 | dataConfirm: false, // 已确认所输入验光数据 |
| 356 | opIsOpen: true, | 276 | opIsOpen: true, |
| 357 | addDisabled: false, | 277 | addDisabled: false, |
| 358 | desDisabled: false, | 278 | desDisabled: false, |
| 359 | // current1: 0, | ||
| 360 | // current2: 0, | ||
| 361 | // current3: 0, | ||
| 362 | current: [], | 279 | current: [], |
| 363 | show: [], | 280 | show: [], |
| 364 | chooseRes1: { | ||
| 365 | sku_name: 'Miss 黑二代【减龄自然】', | ||
| 366 | sk_id: '128', | ||
| 367 | }, | ||
| 368 | checkedData: {}, | 281 | checkedData: {}, |
| 369 | chooseRes2: '14.0', | ||
| 370 | chooseRes3: 0, | ||
| 371 | chooseItem1: [ | ||
| 372 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 148%, #ECEAEA 50%, #8D8C8C 100%);', describ: 'Miss 黑1代【减龄自然】' }, | ||
| 373 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑二代【防紫外线】' }, | ||
| 374 | { style: 'background-image: radial-gradient(50% 148%, #FDF8F6 50%, #94380B 100%);', describ: 'Miss 黑3代【防紫外线】' }, | ||
| 375 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | ||
| 376 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | ||
| 377 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | ||
| 378 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, | ||
| 379 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | ||
| 380 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | ||
| 381 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | ||
| 382 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, | ||
| 383 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | ||
| 384 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | ||
| 385 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | ||
| 386 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, | ||
| 387 | ], | ||
| 388 | chooseItem2: [ | ||
| 389 | { num: '14.0' }, | ||
| 390 | { num: '14.2' }, | ||
| 391 | { num: '14.4' }, | ||
| 392 | { num: '14.5' }, | ||
| 393 | ], | ||
| 394 | chooseItem3: [0, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 470, 500, 525, 550, 575, 600, 1000], | ||
| 395 | // 度数相关数据 | 282 | // 度数相关数据 |
| 396 | pickerInfoList: [ | 283 | pickerInfoList: [ |
| 397 | { nameC: '度数', nameE: '(SPH)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 0 }, | 284 | { nameC: '度数', nameE: '(SPH)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 0 }, |
| 398 | { nameC: '散光', nameE: '(CYL)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 1 }, | 285 | { nameC: '散光', nameE: '(CYL)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 1 }, |
| 399 | { nameC: '散光轴位', nameE: '(AXI)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 2 }, | 286 | { nameC: '散光轴位', nameE: '(AXI)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 2 }, |
| 400 | { nameC: '验光日期', nameE: '', nameArray1: [''], nameIndex1: 0, nameArray2: ['', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], nameIndex2: 0, nameArray3: [''], nameIndex3: 0 }, | 287 | { nameC: '验光日期', nameE: '', nameArray1: [''], nameIndex1: 0, nameArray2: ['', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], nameIndex2: 0, nameArray3: [''], nameIndex3: 0 }, |
| 401 | ], | 288 | ], |
| 402 | confirm: false, // 用户是否确认 | 289 | confirm: false, // 用户是否确认 |
| 403 | tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'], | 290 | tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'], |
| 404 | name: '', | 291 | name: '', |
| 405 | oldname: '', // 用于判读用户是否改变名字 | 292 | oldname: '', // 用于判读用户是否改变名字 |
| 406 | pickerInfoChioce: { | 293 | pickerInfoChioce: { |
| 407 | leftSph: '', | 294 | leftSph: '', |
| 408 | rightSph: '', | 295 | rightSph: '', |
| 409 | leftCyl: '', | 296 | leftCyl: '', |
| 410 | rightCyl: '', | 297 | rightCyl: '', |
| 411 | leftAxi: '', | 298 | leftAxi: '', |
| 412 | rightAxi: '', | 299 | rightAxi: '', |
| 413 | time: { | 300 | time: { |
| 414 | year: 0, | 301 | year: 0, |
| 415 | month: 0, | 302 | month: 0, |
| 416 | day: 0, | 303 | day: 0, |
| 417 | }, | 304 | }, |
| 418 | }, | 305 | }, |
| 419 | pd: '', // 瞳距 | 306 | pd: '', // 瞳距 |
| 420 | oldpd: '', // 用于判断用户是否改变瞳距 | 307 | oldpd: '', // 用于判断用户是否改变瞳距 |
| 421 | kinds: 1, // kinds=1,提交为新增验光,2为修改 | 308 | kinds: 1, // kinds=1,提交为新增验光,2为修改 |
| 422 | mp_id: Number, | 309 | mp_id: Number, |
| 423 | } | 310 | } |
| 424 | }, | 311 | }, |
| 425 | computed: { | 312 | computed: { |
| 426 | loveList() { | 313 | loveList() { |
| 427 | console.log('**********loveList',this.$store.state.myLoveList.loveList) | 314 | // console.log('**********loveList',this.$store.state.myLoveList.loveList) |
| 428 | return this.$store.state.myLoveList.loveList || [] | 315 | return this.$store.state.myLoveList.loveList || [] |
| 429 | }, | 316 | }, |
| 430 | attrList() { | 317 | attrList() { |
| 431 | let attrList = this.$store.state.read.goodInfo.attrList | 318 | let attrList = this.$store.state.read.goodInfo.attrList |
| 432 | if(attrList !== undefined){ | 319 | if(attrList !== undefined){ |
| 433 | return attrList | 320 | return attrList |
| 434 | }else{ | 321 | }else{ |
| 435 | return [] | 322 | return [] |
| 436 | } | 323 | } |
| 437 | }, | 324 | }, |
| 438 | skuList() { | 325 | skuList() { |
| 439 | return this.$store.state.read.goodInfo.skuList | 326 | return this.$store.state.read.goodInfo.skuList |
| 440 | }, | 327 | }, |
| 441 | mpList() { | 328 | mpList() { |
| 442 | return this.$store.state.myLoveList.loveList | 329 | return this.$store.state.myLoveList.loveList |
| 443 | }, | 330 | }, |
| 444 | }, | 331 | }, |
| 445 | created() { | 332 | created() { |
| 446 | const pid = this.pid | 333 | const pid = this.pid |
| 447 | console.log('this.goodInfo',this.goodInfo) | 334 | console.log('this.goodInfo',this.goodInfo) |
| 448 | store.dispatch('read/fetch', { | ||
| 449 | pid, | ||
| 450 | }).then(() => { | ||
| 451 | const current = [] | 335 | const current = [] |
| 452 | const show = [] | 336 | const show = [] |
| 453 | for (let index = 0; index < this.attrList.length; index++) { | 337 | for (let index = 0; index < this.attrList.length; index++) { |
| 454 | current.push(0) | 338 | current.push(0) |
| 455 | show.push(true) | 339 | show.push(true) |
| 456 | } | 340 | } |
| 457 | this.current = current | 341 | this.current = current |
| 458 | this.show = show | 342 | this.show = show |
| 459 | }) | ||
| 460 | 343 | ||
| 461 | //获取关心的人列表 | 344 | //获取关心的人列表 |
| 462 | store.dispatch('myLoveList/getLoveList', { | 345 | store.dispatch('myLoveList/getLoveList', { |
| 463 | uid: this.$store.state.user.userInfo.uid, | 346 | uid: this.$store.state.user.userInfo.uid, |
| 464 | }); | 347 | }); |
| 465 | 348 | ||
| 466 | store.dispatch('myLoveList/getLoveList') | ||
| 467 | 349 | ||
| 468 | // 初始化SPL、CYL、AXI的值 | 350 | // 初始化SPL、CYL、AXI的值 |
| 469 | for (let j = 0; j < 3; j++) { | 351 | for (let j = 0; j < 3; j++) { |
| 470 | for (let i = -12; i < 6; i++) { | 352 | for (let i = -12; i < 6; i++) { |
| 471 | this.pickerInfoList[j].nameArray1.push(i) | 353 | this.pickerInfoList[j].nameArray1.push(i) |
| 472 | this.pickerInfoList[j].nameArray1.push(i + 0.5) | 354 | this.pickerInfoList[j].nameArray1.push(i + 0.5) |
| 473 | this.pickerInfoList[j].nameArray2.push(i) | 355 | this.pickerInfoList[j].nameArray2.push(i) |
| 474 | this.pickerInfoList[j].nameArray2.push(i + 0.5) | 356 | this.pickerInfoList[j].nameArray2.push(i + 0.5) |
| 475 | if (i >= -6) { | 357 | if (i >= -6) { |
| 476 | this.pickerInfoList[j].nameArray1.push(i + 0.25) | 358 | this.pickerInfoList[j].nameArray1.push(i + 0.25) |
| 477 | this.pickerInfoList[j].nameArray1.push(i + 0.75) | 359 | this.pickerInfoList[j].nameArray1.push(i + 0.75) |
| 478 | this.pickerInfoList[j].nameArray2.push(i + 0.25) | 360 | this.pickerInfoList[j].nameArray2.push(i + 0.25) |
| 479 | this.pickerInfoList[j].nameArray2.push(i + 0.75) | 361 | this.pickerInfoList[j].nameArray2.push(i + 0.75) |
| 480 | } | 362 | } |
| 481 | if (i === 5) { | 363 | if (i === 5) { |
| 482 | this.pickerInfoList[j].nameArray1.push(i + 1) | 364 | this.pickerInfoList[j].nameArray1.push(i + 1) |
| 483 | this.pickerInfoList[j].nameArray2.push(i + 1) | 365 | this.pickerInfoList[j].nameArray2.push(i + 1) |
| 484 | } | 366 | } |
| 485 | } | 367 | } |
| 486 | } | 368 | } |
| 487 | // 初始化日期值 | 369 | // 初始化日期值 |
| 488 | for (let i = 1; i < 32; i++) { | 370 | for (let i = 1; i < 32; i++) { |
| 489 | this.pickerInfoList[3].nameArray3.push(i) | 371 | this.pickerInfoList[3].nameArray3.push(i) |
| 490 | } | 372 | } |
| 491 | // 初始化年份前后五年 | 373 | // 初始化年份前后五年 |
| 492 | const myDate = new Date() | 374 | const myDate = new Date() |
| 493 | const nowYear = myDate.getFullYear() | 375 | const nowYear = myDate.getFullYear() |
| 494 | for (let i = 0; i < 5; i++) { | 376 | for (let i = 0; i < 5; i++) { |
| 495 | this.pickerInfoList[3].nameArray1.push(nowYear - i) | 377 | this.pickerInfoList[3].nameArray1.push(nowYear - i) |
| 496 | } | 378 | } |
| 497 | }, | 379 | }, |
| 498 | name : "bottomSheet", | 380 | name : "bottomSheet", |
| 499 | methods: { | 381 | methods: { |
| 500 | onClickLoveItem(index,name){ | 382 | onClickLoveItem(index,name){ |
| 501 | const loveList = this.loveList | 383 | const loveList = this.loveList |
| 502 | for (let index = 0; index < loveList.length; index++) { | 384 | for (let index = 0; index < loveList.length; index++) { |
| 503 | if (name === loveList[index].name && name!==this.name) { | 385 | if (name === loveList[index].name && name!==this.name) { |
| 504 | this.isDataName = true | 386 | this.isDataName = true |
| 505 | uni.showModal({ | ||
| 506 | title: '提示', | ||
| 507 | content: `是否填充已有的"${name}"的数据`, | ||
| 508 | success: (res) => { | ||
| 509 | if (res.confirm) { | ||
| 510 | this.kinds = 2 | 387 | this.kinds = 2 |
| 511 | this.name = loveList[index].name | 388 | this.name = loveList[index].name |
| 512 | this.pd = loveList[index].pd | 389 | this.pd = loveList[index].pd |
| 513 | this.mp_id = loveList[index].mp_id | 390 | this.mp_id = loveList[index].mp_id |
| 514 | this.oldname = loveList[index].name | 391 | this.oldname = loveList[index].name |
| 515 | this.oldpd = loveList[index].pd | 392 | this.oldpd = loveList[index].pd |
| 516 | this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph) | 393 | this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph) |
| 517 | this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph) | 394 | this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph) |
| 518 | this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl) | 395 | this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl) |
| 519 | this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl) | 396 | this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl) |
| 520 | this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi) | 397 | this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi) |
| 521 | this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi) | 398 | this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi) |
| 522 | this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4)) | 399 | this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4)) |
| 523 | if (loveList[index].in_time.toString().slice(5, 6) === 0) { | 400 | if (loveList[index].in_time.toString().slice(5, 6) === 0) { |
| 524 | this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7)) | 401 | this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7)) |
| 525 | } else { | 402 | } else { |
| 526 | this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7)) | 403 | this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7)) |
| 527 | } | 404 | } |
| 528 | if (loveList[index].in_time.toString().slice(8, 9) === 0) { | 405 | if (loveList[index].in_time.toString().slice(8, 9) === 0) { |
| 529 | this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10)) | 406 | this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10)) |
| 530 | } else { | 407 | } else { |
| 531 | this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10)) | 408 | this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10)) |
| 532 | } | 409 | } |
| 533 | } else if (res.cancel) { | ||
| 534 | this.kinds = 2 | ||
| 535 | } | ||
| 536 | }, | ||
| 537 | }) | ||
| 538 | } | 410 | } |
| 539 | } | 411 | } |
| 540 | this.name = name; | 412 | this.name = name; |
| 541 | this.loveCurrent = index; | 413 | this.loveCurrent = index; |
| 542 | }, | 414 | }, |
| 543 | closeSheet(){ | 415 | closeSheet(){ |
| 544 | this.$emit('closeBottom'); | 416 | this.$emit('closeBottom'); |
| 545 | }, | 417 | }, |
| 546 | stopEvent(){ //@click.stop防止事件冒泡 | 418 | stopEvent(){ //@click.stop防止事件冒泡 |
| 547 | 419 | ||
| 548 | }, | 420 | }, |
| 549 | moveHandle(){ //不让页面滚动 | 421 | moveHandle(){ //不让页面滚动 |
| 550 | 422 | ||
| 551 | }, | 423 | }, |
| 552 | // picker相关功能 | 424 | // picker相关功能 |
| 553 | handleInput(e) { | 425 | handleInput(e) { |
| 554 | this.name = e.target.value | 426 | this.name = e.target.value |
| 555 | this.isDataName = false | 427 | this.isDataName = false |
| 556 | console.log('e---->', e) | 428 | console.log('e---->', e) |
| 557 | const mpList = this.mpList | 429 | const mpList = this.mpList |
| 558 | // console.log('mpList===>', mpList) | 430 | // console.log('mpList===>', mpList) |
| 559 | for (let index = 0; index < mpList.length; index++) { | 431 | for (let index = 0; index < mpList.length; index++) { |
| 560 | if (e.detail.value === mpList[index].name) { | 432 | if (e.detail.value === mpList[index].name) { |
| 561 | this.isDataName = true | 433 | this.isDataName = true |
| 562 | uni.showModal({ | 434 | uni.showModal({ |
| 563 | title: '提示', | 435 | title: '提示', |
| 564 | content: `是否填充已有的"${e.detail.value}"的数据`, | 436 | content: `是否填充已有的"${e.detail.value}"的数据`, |
| 565 | success: (res) => { | 437 | success: (res) => { |
| 566 | if (res.confirm) { | 438 | if (res.confirm) { |
| 567 | this.kinds = 2 | 439 | this.kinds = 2 |
| 568 | console.log('args===>', index) | 440 | console.log('args===>', index) |
| 569 | // const mpList=Object.assign({},this.$store.state.mympList.mpList) | 441 | // const mpList=Object.assign({},this.$store.state.mympList.mpList) |
| 570 | console.log('mpList===>', mpList) | 442 | console.log('mpList===>', mpList) |
| 571 | this.name = mpList[index].name | 443 | this.name = mpList[index].name |
| 572 | this.pd = mpList[index].pd | 444 | this.pd = mpList[index].pd |
| 573 | this.mp_id = mpList[index].mp_id | 445 | this.mp_id = mpList[index].mp_id |
| 574 | this.oldname = mpList[index].name | 446 | this.oldname = mpList[index].name |
| 575 | this.oldpd = mpList[index].pd | 447 | this.oldpd = mpList[index].pd |
| 576 | // 将kinds =2时的值传到该页面 | 448 | // 将kinds =2时的值传到该页面 |
| 577 | this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) | 449 | this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) |
| 578 | this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) | 450 | this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) |
| 579 | this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) | 451 | this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) |
| 580 | this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) | 452 | this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) |
| 581 | this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) | 453 | this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) |
| 582 | this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) | 454 | this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) |
| 583 | this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0, 4)) | 455 | this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0, 4)) |
| 584 | if (mpList[index].in_time.toString().slice(5, 6) === 0) { | 456 | if (mpList[index].in_time.toString().slice(5, 6) === 0) { |
| 585 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6, 7)) | 457 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6, 7)) |
| 586 | } else { | 458 | } else { |
| 587 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5, 7)) | 459 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5, 7)) |
| 588 | } | 460 | } |
| 589 | if (mpList[index].in_time.toString().slice(8, 9) === 0) { | 461 | if (mpList[index].in_time.toString().slice(8, 9) === 0) { |
| 590 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9, 10)) | 462 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9, 10)) |
| 591 | } else { | 463 | } else { |
| 592 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8, 10)) | 464 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8, 10)) |
| 593 | } | 465 | } |
| 594 | // this.checkedData = mpList[index] | 466 | // this.checkedData = mpList[index] |
| 595 | // console.log('checkedData', this.checkedData) | 467 | // console.log('checkedData', this.checkedData) |
| 596 | } else if (res.cancel) { | 468 | } else if (res.cancel) { |
| 597 | this.kinds = 2 | 469 | this.kinds = 2 |
| 598 | } | 470 | } |
| 599 | }, | 471 | }, |
| 600 | }) | 472 | }) |
| 601 | } | 473 | } |
| 602 | } | 474 | } |
| 603 | }, | 475 | }, |
| 604 | handleInputPd(e) { | 476 | handleInputPd(e) { |
| 605 | // 只能输入正浮点数或正数 | 477 | // 只能输入正浮点数或正数 |
| 606 | if (/^\d+(\.\d+)?$/.test(e.target.value)) { | 478 | if (/^\d+(\.\d+)?$/.test(e.target.value)) { |
| 607 | this.pd = e.target.value | 479 | this.pd = e.target.value |
| 608 | } else { | 480 | } else { |
| 609 | uni.showToast({ | 481 | uni.showToast({ |
| 610 | title: '请输入有效数据;示例:89', | 482 | title: '请输入有效数据;示例:89', |
| 611 | icon: 'none', | 483 | icon: 'none', |
| 612 | duration: 2000, | 484 | duration: 2000, |
| 613 | }) | 485 | }) |
| 614 | this.pd = '' | 486 | this.pd = '' |
| 615 | } | 487 | } |
| 616 | }, | 488 | }, |
| 617 | changeConfirm() { | 489 | changeConfirm() { |
| 618 | this.confirm = !this.confirm | 490 | this.confirm = !this.confirm |
| 619 | }, | 491 | }, |
| 620 | bindPickerChange01: function(e) { | 492 | bindPickerChange01: function(e) { |
| 621 | this.pickerInfoList[0].nameIndex1 = e.target.value | 493 | this.pickerInfoList[0].nameIndex1 = e.target.value |
| 622 | this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value] | 494 | this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value] |
| 623 | }, | 495 | }, |
| 624 | bindPickerChange02: function(e) { | 496 | bindPickerChange02: function(e) { |
| 625 | this.pickerInfoList[0].nameIndex2 = e.target.value | 497 | this.pickerInfoList[0].nameIndex2 = e.target.value |
| 626 | this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value] | 498 | this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value] |
| 627 | }, | 499 | }, |
| 628 | 500 | ||
| 629 | bindPickerChange11: function(e) { | 501 | bindPickerChange11: function(e) { |
| 630 | this.pickerInfoList[1].nameIndex1 = e.target.value | 502 | this.pickerInfoList[1].nameIndex1 = e.target.value |
| 631 | this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value] | 503 | this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value] |
| 632 | }, | 504 | }, |
| 633 | bindPickerChange12: function(e) { | 505 | bindPickerChange12: function(e) { |
| 634 | this.pickerInfoList[1].nameIndex2 = e.target.value | 506 | this.pickerInfoList[1].nameIndex2 = e.target.value |
| 635 | this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value] | 507 | this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value] |
| 636 | }, | 508 | }, |
| 637 | 509 | ||
| 638 | bindPickerChange21: function(e) { | 510 | bindPickerChange21: function(e) { |
| 639 | this.pickerInfoList[2].nameIndex1 = e.target.value | 511 | this.pickerInfoList[2].nameIndex1 = e.target.value |
| 640 | this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value] | 512 | this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value] |
| 641 | }, | 513 | }, |
| 642 | bindPickerChange22: function(e) { | 514 | bindPickerChange22: function(e) { |
| 643 | this.pickerInfoList[2].nameIndex2 = e.target.value | 515 | this.pickerInfoList[2].nameIndex2 = e.target.value |
| 644 | this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value] | 516 | this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value] |
| 645 | }, | 517 | }, |
| 646 | 518 | ||
| 647 | bindPickerChange41: function(e) { | 519 | bindPickerChange41: function(e) { |
| 648 | this.pickerInfoList[3].nameIndex1 = e.target.value | 520 | this.pickerInfoList[3].nameIndex1 = e.target.value |
| 649 | this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value] | 521 | this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value] |
| 650 | }, | 522 | }, |
| 651 | bindPickerChange42: function(e) { | 523 | bindPickerChange42: function(e) { |
| 652 | this.pickerInfoList[3].nameIndex2 = e.target.value | 524 | this.pickerInfoList[3].nameIndex2 = e.target.value |
| 653 | this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value] | 525 | this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value] |
| 654 | }, | 526 | }, |
| 655 | bindPickerChange43: function(e) { | 527 | bindPickerChange43: function(e) { |
| 656 | this.pickerInfoList[3].nameIndex3 = e.target.value | 528 | this.pickerInfoList[3].nameIndex3 = e.target.value |
| 657 | this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value] | 529 | this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value] |
| 658 | }, | 530 | }, |
| 659 | changeShow(num) { | 531 | changeShow(num) { |
| 660 | this.show[num] = !this.show[num] | 532 | this.show[num] = !this.show[num] |
| 661 | this.$forceUpdate() | 533 | this.$forceUpdate() |
| 662 | }, | 534 | }, |
| 663 | onClickItem(index, i) { | 535 | onClickItem(index, i) { |
| 664 | if (this.current[index] !== i) { | 536 | if (this.current[index] !== i) { |
| 665 | this.current[index] = i | 537 | this.current[index] = i |
| 666 | } | 538 | } |
| 667 | this.$forceUpdate() | 539 | this.$forceUpdate() |
| 668 | }, | 540 | }, |
| 669 | counter(isadd) { | 541 | counter(isadd) { |
| 670 | if (isadd) { | 542 | if (isadd) { |
| 671 | this.count >= this.maxCount ? this.addDisabled = true : this.count++ | 543 | this.count >= this.maxCount ? this.addDisabled = true : this.count++ |
| 672 | } else { | 544 | } else { |
| 673 | this.count <= 1 ? this.desDisabled = true : this.count-- | 545 | this.count <= 1 ? this.desDisabled = true : this.count-- |
| 674 | } | 546 | } |
| 675 | }, | 547 | }, |
| 676 | toComfirmOrder() { | 548 | toComfirmOrder() { |
| 677 | // 先处理验光部分的逻辑,如果ok在跳转 | 549 | // 先处理验光部分的逻辑,如果ok在跳转 |
| 678 | let flag = 0 | 550 | let flag = 0 |
| 679 | if (this.name === '') { | 551 | if (this.name === '') { |
| 680 | uni.showToast({ | 552 | uni.showToast({ |
| 681 | title: '请输入验光单取名', | 553 | title: '请输入验光单取名', |
| 682 | icon: 'none', | 554 | icon: 'none', |
| 683 | duration: 2000, | 555 | duration: 2000, |
| 684 | }) | 556 | }) |
| 685 | } else { | 557 | } else { |
| 686 | if (this.pd === '') { | 558 | if (this.pd === '') { |
| 687 | uni.showToast({ | 559 | uni.showToast({ |
| 688 | title: '请输入瞳距', | 560 | title: '请输入瞳距', |
| 689 | icon: 'none', | 561 | icon: 'none', |
| 690 | duration: 2000, | 562 | duration: 2000, |
| 691 | }) | 563 | }) |
| 692 | } else { | 564 | } else { |
| 693 | if (this.kinds === 1) { | 565 | if (this.kinds === 1) { |
| 694 | // 添加用户验光单 | 566 | // 添加用户验光单 |
| 695 | console.log('kinds====>', this.pickerInfoChioce.leftSph) | 567 | console.log('kinds====>', this.pickerInfoChioce.leftSph) |
| 696 | console.log('kinds====>', this.pickerInfoChioce.leftSph === Number) | 568 | console.log('kinds====>', this.pickerInfoChioce.leftSph === Number) |
| 697 | console.log('kinds====>', this.pickerInfoChioce.rightSph === Number) | 569 | console.log('kinds====>', this.pickerInfoChioce.rightSph === Number) |
| 698 | if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' || | 570 | if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' || |
| 699 | this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' || | 571 | this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' || |
| 700 | this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === '' | 572 | this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === '' |
| 701 | ) { | 573 | ) { |
| 702 | uni.showToast({ | 574 | uni.showToast({ |
| 703 | title: '请输入您的验光数据', | 575 | title: '请输入您的验光数据', |
| 704 | icon: 'none', | 576 | icon: 'none', |
| 705 | duration: 2000, | 577 | duration: 2000, |
| 706 | }) | 578 | }) |
| 707 | } else { | 579 | } else { |
| 708 | if (this.confirm) { | 580 | if (this.confirm) { |
| 709 | store.dispatch('myLoveList/addMylove', { | 581 | store.dispatch('myLoveList/addMylove', { |
| 710 | uid: this.$store.state.user.userInfo.uid, | 582 | uid: this.$store.state.user.userInfo.uid, |
| 711 | openid: this.$store.state.user.userInfo.openid, | 583 | openid: this.$store.state.user.userInfo.openid, |
| 712 | // mp_name: this.$store.state.user.userInfo.mp_name, | 584 | // mp_name: this.$store.state.user.userInfo.mp_name, |
| 713 | leftSph: this.pickerInfoChioce.leftSph, | 585 | leftSph: this.pickerInfoChioce.leftSph, |
| 714 | rightSph: this.pickerInfoChioce.rightSph, | 586 | rightSph: this.pickerInfoChioce.rightSph, |
| 715 | leftCyl: this.pickerInfoChioce.leftCyl, | 587 | leftCyl: this.pickerInfoChioce.leftCyl, |
| 716 | rightCyl: this.pickerInfoChioce.rightCyl, | 588 | rightCyl: this.pickerInfoChioce.rightCyl, |
| 717 | leftAxi: this.pickerInfoChioce.leftAxi, | 589 | leftAxi: this.pickerInfoChioce.leftAxi, |
| 718 | rightAxi: this.pickerInfoChioce.rightAxi, | 590 | rightAxi: this.pickerInfoChioce.rightAxi, |
| 719 | pd: this.pd, // 瞳距 | 591 | pd: this.pd, // 瞳距 |
| 720 | mp_name: this.name, | 592 | mp_name: this.name, |
| 721 | // time: this.pickerInfoChioce.time, | 593 | // time: this.pickerInfoChioce.time, |
| 722 | // img_url2: "http://localhost:8087/images/shop_1/1/", | 594 | // img_url2: "http://localhost:8087/images/shop_1/1/", |
| 723 | }).then(({ mp_id: mpId }) => { | 595 | }).then(({ mp_id: mpId }) => { |
| 724 | this.mp_id = mpId | 596 | this.mp_id = mpId |
| 725 | }) | 597 | }) |
| 726 | flag = 1 | 598 | flag = 1 |
| 727 | } else { | 599 | } else { |
| 728 | uni.showToast({ | 600 | uni.showToast({ |
| 729 | title: '请确认您的验光数据', | 601 | title: '请确认您的验光数据', |
| 730 | icon: 'none', | 602 | icon: 'none', |
| 731 | duration: 3000, | 603 | duration: 3000, |
| 732 | }) | 604 | }) |
| 733 | } | 605 | } |
| 734 | } | 606 | } |
| 735 | } | 607 | } |
| 736 | if (this.kinds === 2) { | 608 | if (this.kinds === 2) { |
| 737 | if (this.confirm) { | 609 | if (this.confirm) { |
| 738 | const leftList = ['leftSph', 'leftCyl', 'leftAxi'] | 610 | const leftList = ['leftSph', 'leftCyl', 'leftAxi'] |
| 739 | const rightList = ['rightSph', 'rightCyl', 'rightAxi'] | 611 | const rightList = ['rightSph', 'rightCyl', 'rightAxi'] |
| 740 | // let flag=0; | 612 | // let flag=0; |
| 741 | if (this.name !== this.oldname) { | 613 | if (this.name !== this.oldname) { |
| 742 | store.dispatch('myLoveList/updateMylove', { | 614 | store.dispatch('myLoveList/updateMylove', { |
| 743 | uid: this.$store.state.user.userInfo.uid, | 615 | uid: this.$store.state.user.userInfo.uid, |
| 744 | openid: this.$store.state.user.userInfo.openid, | 616 | openid: this.$store.state.user.userInfo.openid, |
| 745 | mp_id: this.mp_id, | 617 | mp_id: this.mp_id, |
| 746 | keyname: 'name', | 618 | keyname: 'name', |
| 747 | keyvalue: this.name, | 619 | keyvalue: this.name, |
| 748 | }) | 620 | }) |
| 749 | flag = 1 | 621 | flag = 1 |
| 750 | } | 622 | } |
| 751 | if (this.pd !== this.oldpd) { | 623 | if (this.pd !== this.oldpd) { |
| 752 | store.dispatch('myLoveList/updateMylove', { | 624 | store.dispatch('myLoveList/updateMylove', { |
| 753 | uid: this.$store.state.user.userInfo.uid, | 625 | uid: this.$store.state.user.userInfo.uid, |
| 754 | openid: this.$store.state.user.userInfo.openid, | 626 | openid: this.$store.state.user.userInfo.openid, |
| 755 | mp_id: this.mp_id, | 627 | mp_id: this.mp_id, |
| 756 | keyname: 'pd', | 628 | keyname: 'pd', |
| 757 | keyvalue: this.pd, | 629 | keyvalue: this.pd, |
| 758 | }) | 630 | }) |
| 759 | flag = 1 | 631 | flag = 1 |
| 760 | } | 632 | } |
| 761 | // 先验证是否输入有无空 | 633 | // 先验证是否输入有无空 |
| 762 | let q = true | 634 | let q = true |
| 763 | for (let k = 0; k < 3; k++) { | 635 | for (let k = 0; k < 3; k++) { |
| 764 | q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' && | 636 | q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' && |
| 765 | this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '') | 637 | this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '') |
| 766 | } | 638 | } |
| 767 | if (q) { | 639 | if (q) { |
| 768 | for (let j = 0; j < 3; j++) { | 640 | for (let j = 0; j < 3; j++) { |
| 769 | if (this.pickerInfoList[j].nameIndex1 !== 0) { | 641 | if (this.pickerInfoList[j].nameIndex1 !== 0) { |
| 770 | store.dispatch('myLoveList/updateMylove', { | 642 | store.dispatch('myLoveList/updateMylove', { |
| 771 | uid: this.$store.state.user.userInfo.uid, | 643 | uid: this.$store.state.user.userInfo.uid, |
| 772 | openid: this.$store.state.user.userInfo.openid, | 644 | openid: this.$store.state.user.userInfo.openid, |
| 773 | mp_id: this.mp_id, | 645 | mp_id: this.mp_id, |
| 774 | keyname: leftList[j], | 646 | keyname: leftList[j], |
| 775 | keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], | 647 | keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], |
| 776 | }) | 648 | }) |
| 777 | } | 649 | } |
| 778 | if (this.pickerInfoList[j].nameIndex2 !== 0) { | 650 | if (this.pickerInfoList[j].nameIndex2 !== 0) { |
| 779 | store.dispatch('myLoveList/updateMylove', { | 651 | store.dispatch('myLoveList/updateMylove', { |
| 780 | uid: this.$store.state.user.userInfo.uid, | 652 | uid: this.$store.state.user.userInfo.uid, |
| 781 | openid: this.$store.state.user.userInfo.openid, | 653 | openid: this.$store.state.user.userInfo.openid, |
| 782 | mp_id: this.mp_id, | 654 | mp_id: this.mp_id, |
| 783 | keyname: rightList[j], | 655 | keyname: rightList[j], |
| 784 | keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2], | 656 | keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2], |
| 785 | }) | 657 | }) |
| 786 | } | 658 | } |
| 787 | flag = 1 | 659 | flag = 1 |
| 788 | } | 660 | } |
| 789 | } else { | 661 | } else { |
| 790 | flag = 0 | 662 | flag = 0 |
| 791 | uni.showToast({ | 663 | uni.showToast({ |
| 792 | title: '请输入您的验光数据', | 664 | title: '请输入您的验光数据', |
| 793 | icon: 'none', | 665 | icon: 'none', |
| 794 | duration: 2000, | 666 | duration: 2000, |
| 795 | }) | 667 | }) |
| 796 | } | 668 | } |
| 797 | if (flag !== 0) { | 669 | if (flag !== 0) { |
| 798 | store.dispatch('myLoveList/getLoveList', { | 670 | store.dispatch('myLoveList/getLoveList', { |
| 799 | uid: this.$store.state.user.userInfo.uid, | 671 | uid: this.$store.state.user.userInfo.uid, |
| 800 | }) | 672 | }) |
| 801 | } | 673 | } |
| 802 | } else { | 674 | } else { |
| 803 | uni.showToast({ | 675 | uni.showToast({ |
| 804 | title: '请确认您的验光数据', | 676 | title: '请确认您的验光数据', |
| 805 | icon: 'none', | 677 | icon: 'none', |
| 806 | duration: 3000, | 678 | duration: 3000, |
| 807 | }) | 679 | }) |
| 808 | } | 680 | } |
| 809 | } | 681 | } |
| 810 | } | 682 | } |
| 811 | } | 683 | } |
| 812 | if (flag !== 0) { | 684 | if (flag !== 0) { |
| 813 | // 如果数据验证无误,那么更新验光单的数据 | 685 | // 如果数据验证无误,那么更新验光单的数据 |
| 814 | store.dispatch('myLoveList/getLoveList', { | 686 | store.dispatch('myLoveList/getLoveList', { |
| 815 | uid: this.$store.state.user.userInfo.uid, | 687 | uid: this.$store.state.user.userInfo.uid, |
| 816 | }) | 688 | }) |
| 817 | let i = 0 | 689 | let i = 0 |
| 818 | // 判断出是哪一个sku被选中 | 690 | // 判断出是哪一个sku被选中 |
| 819 | for (let index = 0; index < this.current.length; index++) { | 691 | for (let index = 0; index < this.current.length; index++) { |
| 820 | console.log('index', index, i, index !== this.current.length - 1) | 692 | console.log('index', index, i, index !== this.current.length - 1) |
| 821 | if (index !== this.current.length - 1) { | 693 | if (index !== this.current.length - 1) { |
| 822 | // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 | 694 | // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 |
| 823 | i = this.current[index] * this.attrList[1].attr.length | 695 | i = this.current[index] * this.attrList[1].attr.length |
| 824 | } else { | 696 | } else { |
| 825 | i += this.current[index] | 697 | i += this.current[index] |
| 826 | } | 698 | } |
| 827 | } | 699 | } |
| 828 | // 判断是否其输入的人员数据是否已存在 | 700 | // 判断是否其输入的人员数据是否已存在 |
| 829 | store.dispatch('order/saveParams', { | 701 | store.dispatch('order/saveParams', { |
| 830 | sk_id_arr: this.skuList[i], | 702 | sk_id_arr: this.skuList[i], |
| 831 | current: this.current, | 703 | current: this.current, |
| 832 | mp_id: this.mp_id, | 704 | mp_id: this.mp_id, |
| 833 | attrList: this.attrList, | 705 | attrList: this.attrList, |
| 834 | }) | 706 | }) |
| 835 | // 跳转到确认订单页面 | 707 | // 跳转到确认订单页面 |
| 836 | uni.navigateTo({ | 708 | uni.navigateTo({ |
| 837 | url: `../confirmOrder/confirmOrder?pid=${this.pid}&count=${this.count}&name=${this.name}`, | 709 | url: `../confirmOrder/confirmOrder?pid=${this.pid}&count=${this.count}&name=${this.name}`, |
| 838 | }) | 710 | }) |
| 839 | } | 711 | } |
| 840 | }, | 712 | }, |
| 841 | } | 713 | } |
| 842 | } | 714 | } |
| 843 | </script> | 715 | </script> |
| 844 | 716 | ||
| 845 | <style lang="scss"> | 717 | <style lang="scss"> |
| 846 | .content { | 718 | .content { |
| 847 | min-height: 100vh; | 719 | min-height: 100vh; |
| 848 | background-color: #f2f2f2; | 720 | background-color: #f2f2f2; |
| 849 | // padding-top: 20rpx; | 721 | // padding-top: 20rpx; |
| 850 | .goodInfo { | 722 | .goodInfo { |
| 851 | width: 100%; | 723 | width: 100%; |
| 852 | height: 272rpx; | 724 | height: 272rpx; |
| 853 | border-radius: 16rpx; | 725 | border-radius: 16rpx; |
| 854 | background-color: #ffffff; | 726 | background-color: #ffffff; |
| 855 | box-sizing: border-box; | 727 | box-sizing: border-box; |
| 856 | padding: 36rpx; | 728 | padding: 36rpx; |
| 857 | display: flex; | 729 | display: flex; |
| 858 | flex-direction: row; | 730 | flex-direction: row; |
| 859 | justify-content: flex-start; | 731 | justify-content: flex-start; |
| 860 | .imageWrap { | 732 | .imageWrap { |
| 861 | height: 188rpx; | 733 | height: 188rpx; |
| 862 | width: 188rpx; | 734 | width: 188rpx; |
| 863 | margin-right: 28rpx; | 735 | margin-right: 28rpx; |
| 864 | image { | 736 | image { |
| 865 | height: 188rpx; | 737 | height: 188rpx; |
| 866 | width: 188rpx; | 738 | width: 188rpx; |
| 867 | } | 739 | } |
| 868 | } | 740 | } |
| 869 | .infoRight { | 741 | .infoRight { |
| 870 | display: flex; | 742 | display: flex; |
| 871 | flex-direction: column; | 743 | flex-direction: column; |
| 872 | align-items: flex-start; | 744 | align-items: flex-start; |
| 873 | justify-content: space-between; | 745 | justify-content: space-between; |
| 874 | .goodName { | 746 | .goodName { |
| 875 | font-size: 28rpx; | 747 | font-size: 28rpx; |
| 876 | color: #333333; | 748 | color: #333333; |
| 877 | } | 749 | } |
| 878 | .remarks { | 750 | .remarks { |
| 879 | font-size: 20rpx; | 751 | font-size: 20rpx; |
| 880 | color: #999999; | 752 | color: #999999; |
| 881 | } | 753 | } |
| 882 | .priceBox { | 754 | .priceBox { |
| 883 | display: flex; | 755 | display: flex; |
| 884 | justify-content: space-between; | 756 | justify-content: space-between; |
| 885 | align-items: center; | 757 | align-items: center; |
| 886 | width: 100%; | 758 | width: 100%; |
| 887 | font-size: 14px; | 759 | font-size: 14px; |
| 888 | color: #999999; | 760 | color: #999999; |
| 889 | .price { | 761 | .price { |
| 890 | color: #ff6b4a; | 762 | color: #ff6b4a; |
| 891 | font-size: 28rpx; | 763 | font-size: 28rpx; |
| 892 | } | 764 | } |
| 893 | .counter { | 765 | .counter { |
| 894 | display: flex; | 766 | display: flex; |
| 895 | flex-direction: row; | 767 | flex-direction: row; |
| 896 | justify-content: space-between; | 768 | justify-content: space-between; |
| 897 | align-items: center; | 769 | align-items: center; |
| 898 | font-size: 28rpx; | 770 | font-size: 28rpx; |
| 899 | color: #333333; | 771 | color: #333333; |
| 900 | width: 122rpx; | 772 | width: 122rpx; |
| 901 | .btn { | 773 | .btn { |
| 902 | display: flex; | 774 | display: flex; |
| 903 | justify-content: center; | 775 | justify-content: center; |
| 904 | line-height: 32rpx; | 776 | line-height: 32rpx; |
| 905 | height: 32rpx; | 777 | height: 32rpx; |
| 906 | width: 32rpx; | 778 | width: 32rpx; |
| 907 | background-color: #f2f2f2; | 779 | background-color: #f2f2f2; |
| 908 | color: #cfcfcf; | 780 | color: #cfcfcf; |
| 909 | } | 781 | } |
| 910 | } | 782 | } |
| 911 | } | 783 | } |
| 912 | } | 784 | } |
| 913 | } | 785 | } |
| 914 | .peopleChoose{ | 786 | .peopleChoose{ |
| 915 | width: 100%; | 787 | width: 100%; |
| 916 | min-height: 200rpx; | 788 | min-height: 200rpx; |
| 917 | border-radius: 16rpx; | 789 | border-radius: 16rpx; |
| 918 | background-color: #ffffff; | 790 | background-color: #ffffff; |
| 919 | box-sizing: border-box; | 791 | box-sizing: border-box; |
| 920 | padding: 36rpx; | 792 | padding: 36rpx; |
| 921 | margin: 10px 0; | 793 | margin: 10px 0; |
| 922 | display: flex; | 794 | display: flex; |
| 923 | flex-direction: column; | 795 | flex-direction: column; |
| 924 | justify-content: flex-start; | 796 | justify-content: flex-start; |
| 925 | align-items: center; | 797 | align-items: center; |
| 926 | .title{ | 798 | .title{ |
| 927 | font-size: 16px; | 799 | font-size: 16px; |
| 928 | color: #333333; | 800 | color: #333333; |
| 929 | letter-spacing: -0.3px; | 801 | letter-spacing: -0.3px; |
| 930 | text-align: justify; | 802 | text-align: justify; |
| 931 | line-height: 24px; | 803 | line-height: 24px; |
| 932 | margin: 4px 0; | 804 | margin: 4px 0; |
| 933 | } | 805 | } |
| 934 | .loveList{ | 806 | .loveList{ |
| 935 | display: flex; | 807 | display: flex; |
| 936 | flex-direction: row; | 808 | flex-direction: row; |
| 937 | flex-wrap: wrap; | 809 | flex-wrap: wrap; |
| 938 | justify-content: flex-start; | 810 | justify-content: flex-start; |
| 939 | align-items: center; | 811 | align-items: center; |
| 940 | padding-top: 24rpx; | 812 | padding-top: 24rpx; |
| 941 | width: 100%; | 813 | width: 100%; |
| 942 | .peopleName { | 814 | .peopleName { |
| 943 | padding: 0 30rpx; | 815 | padding: 0 30rpx; |
| 944 | height: 60rpx; | 816 | height: 60rpx; |
| 945 | margin: 0 20rpx 20rpx 0; | 817 | margin: 0 20rpx 20rpx 0; |
| 946 | transition: all 0.3s; | 818 | transition: all 0.3s; |
| 947 | background: #f2f2f2; | 819 | background: #f2f2f2; |
| 948 | border-radius: 2px; | 820 | border-radius: 2px; |
| 949 | border-radius: 2px; | 821 | border-radius: 2px; |
| 950 | line-height: 60rpx; | 822 | line-height: 60rpx; |
| 951 | text-align: center; | 823 | text-align: center; |
| 952 | color: #666666; | 824 | color: #666666; |
| 953 | font-size: 12px; | 825 | font-size: 12px; |
| 954 | } | 826 | } |
| 955 | .active2 { | 827 | .active2 { |
| 956 | background: rgba(255, 107, 74, 0.15); | 828 | background: rgba(255, 107, 74, 0.15); |
| 957 | color: #ff6b4a; | 829 | color: #ff6b4a; |
| 958 | } | 830 | } |
| 959 | } | 831 | } |
| 960 | } | 832 | } |
| 961 | .goods-data { | 833 | .goods-data { |
| 962 | width: 100%; | 834 | width: 100%; |
| 963 | box-sizing: border-box; | 835 | box-sizing: border-box; |
| 964 | padding: 37rpx 40rpx 0 40rpx; | 836 | padding: 37rpx 40rpx 0 40rpx; |
| 965 | background: #ffffff; | 837 | background: #ffffff; |
| 966 | border-radius: 12rpx; | 838 | border-radius: 12rpx; |
| 967 | .opCollapse { | 839 | .opCollapse { |
| 968 | width: 100%; | 840 | width: 100%; |
| 969 | padding-bottom: 28rpx; | 841 | padding-bottom: 28rpx; |
| 970 | margin-top: 7px; | 842 | margin-top: 7px; |
| 971 | border-bottom: 1px solid #e9e9e9; | 843 | border-bottom: 1px solid #e9e9e9; |
| 972 | .head { | 844 | .head { |
| 973 | display: flex; | 845 | display: flex; |
| 974 | justify-content: space-between; | 846 | justify-content: space-between; |
| 975 | height: 24px; | 847 | height: 24px; |
| 976 | // font-family: PingFangSC-Medium; | 848 | // font-family: PingFangSC-Medium; |
| 977 | font-size: 16px; | 849 | font-size: 16px; |
| 978 | color: #333333; | 850 | color: #333333; |
| 979 | letter-spacing: -0.3px; | 851 | letter-spacing: -0.3px; |
| 980 | text-align: justify; | 852 | text-align: justify; |
| 981 | line-height: 24px; | 853 | line-height: 24px; |
| 982 | margin-bottom: 18rpx; | 854 | margin-bottom: 18rpx; |
| 983 | .headRighted { | 855 | .headRighted { |
| 984 | width: 0; | 856 | width: 0; |
| 985 | height: 0; | 857 | height: 0; |
| 986 | border-left: 4px solid transparent; | 858 | border-left: 4px solid transparent; |
| 987 | border-right: 4px solid transparent; | 859 | border-right: 4px solid transparent; |
| 988 | border-bottom: 4px solid #cfcfcf; | 860 | border-bottom: 4px solid #cfcfcf; |
| 989 | transform: scaleY(-1); | 861 | transform: scaleY(-1); |
| 990 | margin-top: 10px; | 862 | margin-top: 10px; |
| 991 | } | 863 | } |
| 992 | .headMid { | 864 | .headMid { |
| 993 | font-size: 10px; | 865 | font-size: 10px; |
| 994 | color: #999999; | 866 | color: #999999; |
| 995 | letter-spacing: -0.19px; | 867 | letter-spacing: -0.19px; |
| 996 | margin-left: -120rpx; | 868 | margin-left: -120rpx; |
| 997 | } | 869 | } |
| 998 | .headRight { | 870 | .headRight { |
| 999 | width: 0; | 871 | width: 0; |
| 1000 | height: 0; | 872 | height: 0; |
| 1001 | border-left: 4px solid transparent; | 873 | border-left: 4px solid transparent; |
| 1002 | border-right: 4px solid transparent; | 874 | border-right: 4px solid transparent; |
| 1003 | border-bottom: 4px solid #cfcfcf; | 875 | border-bottom: 4px solid #cfcfcf; |
| 1004 | margin-top: 10px; | 876 | margin-top: 10px; |
| 1005 | } | 877 | } |
| 1006 | } | 878 | } |
| 1007 | .body { | 879 | .body { |
| 1008 | font-size: 12px; | 880 | font-size: 12px; |
| 1009 | color: #666666; | 881 | color: #666666; |
| 1010 | letter-spacing: 0; | 882 | letter-spacing: 0; |
| 1011 | .bodyBox { | 883 | .bodyBox { |
| 1012 | margin-top: 15px; | 884 | margin-top: 15px; |
| 1013 | .names { | 885 | .names { |
| 1014 | font-size: 12px; | 886 | font-size: 12px; |
| 1015 | color: #151515; | 887 | color: #151515; |
| 1016 | letter-spacing: 0; | 888 | letter-spacing: 0; |
| 1017 | text-align: justify; | 889 | text-align: justify; |
| 1018 | line-height: 17px; | 890 | line-height: 17px; |
| 1019 | margin-left: 5px; | 891 | margin-left: 5px; |
| 1020 | margin-right: 10px; | 892 | margin-right: 10px; |
| 1021 | } | 893 | } |
| 1022 | text { | 894 | text { |
| 1023 | font-size: 12px; | 895 | font-size: 12px; |
| 1024 | color: #666666; | 896 | color: #666666; |
| 1025 | letter-spacing: 0; | 897 | letter-spacing: 0; |
| 1026 | text-align: justify; | 898 | text-align: justify; |
| 1027 | } | 899 | } |
| 1028 | } | 900 | } |
| 1029 | } | 901 | } |
| 1030 | .goods-form { | 902 | .goods-form { |
| 1031 | display: flex; | 903 | display: flex; |
| 1032 | flex-direction: column; | 904 | flex-direction: column; |
| 1033 | align-items: center; | 905 | align-items: center; |
| 1034 | justify-content: center; | 906 | justify-content: center; |
| 1035 | background-color: #fff; | 907 | background-color: #fff; |
| 1036 | width: 100%; | 908 | width: 100%; |
| 1037 | padding: 40rpx 0; | 909 | padding: 40rpx 0; |
| 1038 | .p1 { | 910 | .p1 { |
| 1039 | font-size: 16px; | 911 | font-size: 16px; |
| 1040 | color: #333333; | 912 | color: #333333; |
| 1041 | letter-spacing: -0.3px; | 913 | letter-spacing: -0.3px; |
| 1042 | text-align: justify; | 914 | text-align: justify; |
| 1043 | line-height: 24px; | 915 | line-height: 24px; |
| 1044 | margin: 4px 0; | 916 | margin: 4px 0; |
| 1045 | 917 | ||
| 1046 | } | 918 | } |
| 1047 | .p2 { | 919 | .p2 { |
| 1048 | font-size: 12px; | 920 | font-size: 12px; |
| 1049 | color: #999999; | 921 | color: #999999; |
| 1050 | letter-spacing: -0.23px; | 922 | letter-spacing: -0.23px; |
| 1051 | margin-bottom: 32rpx; | 923 | margin-bottom: 32rpx; |
| 1052 | } | 924 | } |
| 1053 | .image2{ | 925 | .image2{ |
| 1054 | width: 42rpx; | 926 | width: 42rpx; |
| 1055 | height: 34rpx; | 927 | height: 34rpx; |
| 1056 | margin-right: 12rpx; | 928 | margin-right: 12rpx; |
| 1057 | } | 929 | } |
| 1058 | .confirm { | 930 | .confirm { |
| 1059 | display: flex; | 931 | display: flex; |
| 1060 | align-items: center; | 932 | align-items: center; |
| 1061 | font-size: 12px; | 933 | font-size: 12px; |
| 1062 | color: #666666; | 934 | color: #666666; |
| 1063 | letter-spacing: -0.23px; | 935 | letter-spacing: -0.23px; |
| 1064 | width: 684rpx; | 936 | width: 684rpx; |
| 1065 | .image1{ | 937 | .image1{ |
| 1066 | margin-right:25rpx; | 938 | margin-right:25rpx; |
| 1067 | width: 42rpx; | 939 | width: 42rpx; |
| 1068 | height: 38rpx; | 940 | height: 38rpx; |
| 1069 | } | 941 | } |
| 1070 | } | 942 | } |
| 1071 | .picker{ | 943 | .picker{ |
| 1072 | display: flex; | 944 | display: flex; |
| 1073 | flex-direction: column; | 945 | flex-direction: column; |
| 1074 | justify-content: center; | 946 | justify-content: center; |
| 1075 | align-items: center; | 947 | align-items: center; |
| 1076 | width: 100%; | 948 | width: 100%; |
| 1077 | 949 | ||
| 1078 | .picker-choice{ | 950 | .picker-choice{ |
| 1079 | display: flex; | 951 | display: flex; |
| 1080 | width: 684rpx; | 952 | width: 684rpx; |
| 1081 | align-items: center; | 953 | align-items: center; |
| 1082 | margin-bottom: 40rpx; | 954 | margin-bottom: 40rpx; |
| 1083 | .input{ | 955 | .input{ |
| 1084 | border-bottom: 1px solid #CFCFCF; | 956 | border-bottom: 1px solid #CFCFCF; |
| 1085 | height: 40rpx; | 957 | height: 40rpx; |
| 1086 | } | 958 | } |
| 1087 | .choice-left{ | 959 | .choice-left{ |
| 1088 | width: 210rpx; | 960 | width: 210rpx; |
| 1089 | .pd{ | 961 | .pd{ |
| 1090 | font-size: 14px; | 962 | font-size: 14px; |
| 1091 | color: #333333; | 963 | color: #333333; |
| 1092 | letter-spacing: -0.26px; | 964 | letter-spacing: -0.26px; |
| 1093 | text-align: justify; | 965 | text-align: justify; |
| 1094 | line-height: 24px; | 966 | line-height: 24px; |
| 1095 | margin-right: 44rpx; | 967 | margin-right: 44rpx; |
| 1096 | } | 968 | } |
| 1097 | .p11 { | 969 | .p11 { |
| 1098 | font-size: 14px; | 970 | font-size: 14px; |
| 1099 | color: #333333; | 971 | color: #333333; |
| 1100 | letter-spacing: -0.26px; | 972 | letter-spacing: -0.26px; |
| 1101 | text-align: justify; | 973 | text-align: justify; |
| 1102 | line-height: 24px; | 974 | line-height: 24px; |
| 1103 | // margin-right: 10px; | 975 | // margin-right: 10px; |
| 1104 | } | 976 | } |
| 1105 | .p12 { | 977 | .p12 { |
| 1106 | font-size: 10px; | 978 | font-size: 10px; |
| 1107 | color: #3F3F3F; | 979 | color: #3F3F3F; |
| 1108 | letter-spacing: -0.19px; | 980 | letter-spacing: -0.19px; |
| 1109 | text-align: justify; | 981 | text-align: justify; |
| 1110 | line-height: 24px; | 982 | line-height: 24px; |
| 1111 | } | 983 | } |
| 1112 | 984 | ||
| 1113 | } | 985 | } |
| 1114 | .p13 { | 986 | .p13 { |
| 1115 | font-size: 10px; | 987 | font-size: 10px; |
| 1116 | color: #999999; | 988 | color: #999999; |
| 1117 | letter-spacing: -0.19px; | 989 | letter-spacing: -0.19px; |
| 1118 | margin-right: 10px; | 990 | margin-right: 10px; |
| 1119 | } | 991 | } |
| 1120 | .p13-date { | 992 | .p13-date { |
| 1121 | font-size: 10px; | 993 | font-size: 10px; |
| 1122 | color: #999999; | 994 | color: #999999; |
| 1123 | letter-spacing: -0.19px; | 995 | letter-spacing: -0.19px; |
| 1124 | margin-right: 5px; | 996 | margin-right: 5px; |
| 1125 | } | 997 | } |
| 1126 | picker{ | 998 | picker{ |
| 1127 | width: 144rpx; | 999 | width: 144rpx; |
| 1128 | height: 40rpx; | 1000 | height: 40rpx; |
| 1129 | display: flex; | 1001 | display: flex; |
| 1130 | position: relative; | 1002 | position: relative; |
| 1131 | .p14 { | 1003 | .p14 { |
| 1132 | font-size: 14px; | 1004 | font-size: 14px; |
| 1133 | color: #666666; | 1005 | color: #666666; |
| 1134 | letter-spacing: -0.26px; | 1006 | letter-spacing: -0.26px; |
| 1135 | text-align: center; | 1007 | text-align: center; |
| 1136 | width: 124rpx; | 1008 | width: 124rpx; |
| 1137 | border-bottom: 1px solid #CFCFCF; | 1009 | border-bottom: 1px solid #CFCFCF; |
| 1138 | height: 38rpx; | 1010 | height: 38rpx; |
| 1139 | } | 1011 | } |
| 1140 | image{ | 1012 | image{ |
| 1141 | width: 20rpx; | 1013 | width: 20rpx; |
| 1142 | height: 20rpx; | 1014 | height: 20rpx; |
| 1143 | position: absolute; | 1015 | position: absolute; |
| 1144 | right: 20rpx; | 1016 | right: 20rpx; |
| 1145 | top: 8rpx; | 1017 | top: 8rpx; |
| 1146 | } | 1018 | } |
| 1147 | } | 1019 | } |
| 1148 | 1020 | ||
| 1149 | } | 1021 | } |
| 1150 | } | 1022 | } |
| 1151 | } | 1023 | } |
| 1152 | } | 1024 | } |
| 1153 | } | 1025 | } |
| 1154 | .choose { | 1026 | .choose { |
| 1155 | width: 100%; | 1027 | width: 100%; |
| 1156 | background: #ffffff; | 1028 | background: #ffffff; |
| 1157 | border-radius: 12rpx; | 1029 | border-radius: 12rpx; |
| 1158 | margin-top: 20rpx; | 1030 | margin-top: 20rpx; |
| 1159 | padding: 40rpx 40rpx 112rpx 40rpx; | 1031 | padding: 40rpx 40rpx 112rpx 40rpx; |
| 1160 | box-sizing: border-box; | 1032 | box-sizing: border-box; |
| 1161 | .chooseItem { | 1033 | .chooseItem { |
| 1162 | width: 100%; | 1034 | width: 100%; |
| 1163 | padding-bottom: 32rpx; | 1035 | padding-bottom: 32rpx; |
| 1164 | border-bottom: 1px solid #e9e9e9; | 1036 | border-bottom: 1px solid #e9e9e9; |
| 1165 | margin-bottom: 28rpx; | 1037 | margin-bottom: 28rpx; |
| 1166 | } | 1038 | } |
| 1167 | .chooseRes { | 1039 | .chooseRes { |
| 1168 | font-size: 12px; | 1040 | font-size: 12px; |
| 1169 | color: #666666; | 1041 | color: #666666; |
| 1170 | } | 1042 | } |
| 1171 | .itemsWrap { | 1043 | .itemsWrap { |
| 1172 | display: flex; | 1044 | display: flex; |
| 1173 | flex-direction: row; | 1045 | flex-direction: row; |
| 1174 | flex-wrap: wrap; | 1046 | flex-wrap: wrap; |
| 1175 | justify-content: flex-start; | 1047 | justify-content: flex-start; |
| 1176 | align-items: center; | 1048 | align-items: center; |
| 1177 | padding-top: 24rpx; | 1049 | padding-top: 24rpx; |
| 1178 | .item1 { | 1050 | .item1 { |
| 1179 | width: 64rpx; | 1051 | width: 64rpx; |
| 1180 | height: 64rpx; | 1052 | height: 64rpx; |
| 1181 | border-radius: 32rpx; | 1053 | border-radius: 32rpx; |
| 1182 | margin: 0 36rpx 24rpx 0; | 1054 | margin: 0 36rpx 24rpx 0; |
| 1183 | transition: all 0.3s; | 1055 | transition: all 0.3s; |
| 1184 | border: 1px solid #ffffff; | 1056 | border: 1px solid #ffffff; |
| 1185 | } | 1057 | } |
| 1186 | .item2 { | 1058 | .item2 { |
| 1187 | // width: 100rpx; | 1059 | // width: 100rpx; |
| 1188 | padding: 0 30rpx; | 1060 | padding: 0 30rpx; |
| 1189 | height: 60rpx; | 1061 | height: 60rpx; |
| 1190 | margin: 0 20rpx 20rpx 0; | 1062 | margin: 0 20rpx 20rpx 0; |
| 1191 | transition: all 0.3s; | 1063 | transition: all 0.3s; |
| 1192 | background: #f2f2f2; | 1064 | background: #f2f2f2; |
| 1193 | border-radius: 2px; | 1065 | border-radius: 2px; |
| 1194 | border-radius: 2px; | 1066 | border-radius: 2px; |
| 1195 | line-height: 60rpx; | 1067 | line-height: 60rpx; |
| 1196 | text-align: center; | 1068 | text-align: center; |
| 1197 | color: #666666; | 1069 | color: #666666; |
| 1198 | font-size: 12px; | 1070 | font-size: 12px; |
| 1199 | } | 1071 | } |
| 1200 | .active1 { | 1072 | .active1 { |
| 1201 | opacity: 0.7; | 1073 | opacity: 0.7; |
| 1202 | border: 1px solid #ff6b4a; | 1074 | border: 1px solid #ff6b4a; |
| 1203 | } | 1075 | } |
| 1204 | .active2 { | 1076 | .active2 { |
| 1205 | background: rgba(255, 107, 74, 0.15); | 1077 | background: rgba(255, 107, 74, 0.15); |
| 1206 | color: #ff6b4a; | 1078 | color: #ff6b4a; |
| 1207 | } | 1079 | } |
| 1208 | } | 1080 | } |
| 1209 | } | 1081 | } |
| 1210 | .button { | 1082 | .button { |
| 1211 | width: 100%; | 1083 | width: 100%; |
| 1212 | height: 112rpx; | 1084 | height: 112rpx; |
| 1213 | background-color: #ff6b4a; | 1085 | background-color: #ff6b4a; |
| 1214 | font-size: 16px; | 1086 | font-size: 16px; |
| 1215 | color: #ffffff; | 1087 | color: #ffffff; |
| 1216 | line-height: 112rpx; | 1088 | line-height: 112rpx; |
| 1217 | text-align: center; | 1089 | text-align: center; |
| 1218 | // position: absolute; | 1090 | // position: absolute; |
| 1219 | bottom: 0; | 1091 | bottom: 0; |
| 1220 | left: 0; | 1092 | left: 0; |
| 1221 | } | 1093 | } |
| 1222 | } | 1094 | } |
| 1223 | /* sheet弹窗 */ | 1095 | /* sheet弹窗 */ |
| 1224 | .sheet{ | 1096 | .sheet{ |
| 1225 | width: 100%; | 1097 | width: 100%; |
| 1226 | height: 100%; | 1098 | height: 100%; |
| 1227 | position: fixed; | 1099 | position: fixed; |
| 1228 | top: 150%; | 1100 | top: 150%; |
| 1229 | left: 0upx; | 1101 | left: 0upx; |
| 1230 | bottom: 0upx; | 1102 | bottom: 0upx; |
| 1231 | right: 0upx; | 1103 | right: 0upx; |
| 1232 | background:rgba(0,0,0,0.3); | 1104 | background:rgba(0,0,0,0.3); |
| 1233 | z-index: 10000; | 1105 | z-index: 10000; |
| 1234 | } | 1106 | } |
| 1235 | 1107 | ||
| 1236 | /* 显示时候的动画默认0.5s */ | 1108 | /* 显示时候的动画默认0.5s */ |
| 1237 | .sheetView{ | 1109 | .sheetView{ |
| 1238 | width: 100%; | 1110 | width: 100%; |
| 1239 | height: 0upx; | 1111 | height: 0upx; |
| 1240 | position: absolute; | 1112 | position: absolute; |
| 1241 | bottom: 0upx; | 1113 | bottom: 0upx; |
| 1242 | background: white; | 1114 | background: white; |
| 1243 | z-index: 10001; | 1115 | z-index: 10001; |
| 1244 | transition: all 0.5s; | 1116 | transition: all 0.5s; |
| 1245 | } | 1117 | } |
| 1246 | .sheetShow{ | 1118 | .sheetShow{ |
| 1247 | top:0upx !important; | 1119 | top:0upx !important; |
| 1248 | } | 1120 | } |
| 1249 | /* 关闭时的动画,时间自己可以设置0.5s*/ | 1121 | /* 关闭时的动画,时间自己可以设置0.5s*/ |
| 1250 | .sheeHide{ | 1122 | .sheeHide{ |
| 1251 | top:120% !important; | 1123 | top:120% !important; |
| 1252 | transition: all 0.5s; | 1124 | transition: all 0.5s; |
| 1253 | } | 1125 | } |
| 1254 | 1126 | ||
| 1255 | /* 项目需求根据设计稿要展示的高度,超出这个高度就自动滚动*/ | 1127 | /* 项目需求根据设计稿要展示的高度,超出这个高度就自动滚动*/ |
| 1256 | .sheetView_active{ | 1128 | .sheetView_active{ |
| 1257 | height: 942upx; | 1129 | height: 942upx; |
| 1258 | } | 1130 | } |
| 1259 | 1131 | ||
| 1260 | </style> | 1132 | </style> |
| 1261 | 1133 |