Commit 003b650d8bcb32c05e5e24a63e7a04657685d9c2
1 parent
17549cb4
健康商城需要用到填写地址,积分加现金兑换不用到地址填写
Showing
3 changed files
with
50 additions
and
65 deletions
src/components/appAddressToast/appAddressToast.vue
| ... | ... | @@ -132,7 +132,8 @@ export default { |
| 132 | 132 | confirm () { |
| 133 | 133 | // 最新地址信息回传给父组件 |
| 134 | 134 | // this.$parent.addressInfo = this.addressInfo; |
| 135 | - this.addLuckDrawAddress(); | |
| 135 | + // this.addLuckDrawAddress(); | |
| 136 | + this.$emit("toUpdate", this.addressInfo.id); | |
| 136 | 137 | // 隐藏弹框 |
| 137 | 138 | this.$parent.pointsToast_control = false; |
| 138 | 139 | }, |
| ... | ... | @@ -150,42 +151,42 @@ export default { |
| 150 | 151 | * *@param {string} id [商品id] |
| 151 | 152 | * *@param {string} id_card [身份证id] |
| 152 | 153 | */ |
| 153 | - addLuckDrawAddress () { | |
| 154 | - // 加载中提示 | |
| 155 | - Indicator.open("加载中..."); | |
| 156 | - // 请求接口 | |
| 157 | - this.http( | |
| 158 | - "/Api/" + this.getApiVersion().LuckDraw + "/addLuckIntegralAddress", | |
| 159 | - { | |
| 160 | - uid: this.getStore("uid"), | |
| 161 | - addressId: this.addressInfo.id, | |
| 162 | - id: this.itemInfo.id // 商品ID | |
| 163 | - }, | |
| 164 | - this.addLuckDrawAddressCallback, | |
| 165 | - { | |
| 166 | - method: "POST" | |
| 167 | - // ext: this.itemInfo | |
| 168 | - } | |
| 169 | - ); | |
| 170 | - }, | |
| 154 | + // addLuckDrawAddress () { | |
| 155 | + // // 加载中提示 | |
| 156 | + // Indicator.open("加载中..."); | |
| 157 | + // // 请求接口 | |
| 158 | + // this.http( | |
| 159 | + // "/Api/" + this.getApiVersion().LuckDraw + "/addLuckIntegralAddress", | |
| 160 | + // { | |
| 161 | + // uid: this.getStore("uid"), | |
| 162 | + // addressId: this.addressInfo.id, | |
| 163 | + // id: this.itemInfo.id // 商品ID | |
| 164 | + // }, | |
| 165 | + // this.addLuckDrawAddressCallback, | |
| 166 | + // { | |
| 167 | + // method: "POST" | |
| 168 | + // // ext: this.itemInfo | |
| 169 | + // } | |
| 170 | + // ); | |
| 171 | + // }, | |
| 171 | 172 | |
| 172 | 173 | /** |
| 173 | 174 | * 提交中奖的商品信息 |
| 174 | 175 | * @param {object} res [服务器返回数据] |
| 175 | 176 | * @param {object} ext [扩展参数] |
| 176 | 177 | */ |
| 177 | - addLuckDrawAddressCallback (res, ext) { | |
| 178 | - // 加载完成 | |
| 179 | - Indicator.close(); | |
| 180 | - // 返回处理 | |
| 181 | - if (res.code == 200) { | |
| 182 | - Toast("提交成功等待发货"); | |
| 183 | - this.$emit("toUpdate", this.itemInfo, this.addressInfo); | |
| 184 | - } else { | |
| 185 | - // 兑换礼品失败 | |
| 186 | - Toast(res.message); | |
| 187 | - } | |
| 188 | - } | |
| 178 | + // addLuckDrawAddressCallback (res, ext) { | |
| 179 | + // // 加载完成 | |
| 180 | + // Indicator.close(); | |
| 181 | + // // 返回处理 | |
| 182 | + // if (res.code == 200) { | |
| 183 | + // Toast("提交成功等待发货"); | |
| 184 | + // this.$emit("toUpdate", this.itemInfo, this.addressInfo); | |
| 185 | + // } else { | |
| 186 | + // // 兑换礼品失败 | |
| 187 | + // Toast(res.message); | |
| 188 | + // } | |
| 189 | + // } | |
| 189 | 190 | } |
| 190 | 191 | }; |
| 191 | 192 | </script> | ... | ... |
src/pages/goodDetails/goodDetails.vue
| ... | ... | @@ -180,7 +180,7 @@ import callAppBox from "@/components/callAppBox/callAppBox"; |
| 180 | 180 | import swiper from "@/components/swiper/swiper"; |
| 181 | 181 | import backBox from "@/components/backBox/backBox"; |
| 182 | 182 | import columnListBox from "@/components/columnListBox/columnListBox"; |
| 183 | -import appAddressToast from "@/components/appAddressToast/appAddressToast"; | |
| 183 | +// import appAddressToast from "@/components/appAddressToast/appAddressToast"; | |
| 184 | 184 | import { Toast, Indicator } from "mint-ui"; |
| 185 | 185 | export default { |
| 186 | 186 | name: 'goodDetails', |
| ... | ... | @@ -202,7 +202,7 @@ export default { |
| 202 | 202 | swiper, |
| 203 | 203 | backBox, |
| 204 | 204 | columnListBox, |
| 205 | - appAddressToast | |
| 205 | + // appAddressToast | |
| 206 | 206 | }, |
| 207 | 207 | //静态 |
| 208 | 208 | props: [ |
| ... | ... | @@ -375,6 +375,7 @@ export default { |
| 375 | 375 | if (this.goodsInfo.shop_type == 1) { |
| 376 | 376 | // 实物弹出底部数量填写弹窗 |
| 377 | 377 | this.opintsPopup(); |
| 378 | + // 弹出填写地址 | |
| 378 | 379 | // this.addAddressCallback() |
| 379 | 380 | } else { |
| 380 | 381 | // isExchange为false才可兑换防止连续点击 | ... | ... |
src/pages/healthGoodDetails/healthGoodDetails.vue
| ... | ... | @@ -161,7 +161,7 @@ |
| 161 | 161 | </div> |
| 162 | 162 | <!-- 有健康值商品售罄 --> |
| 163 | 163 | <div v-else-if="goodsInfo && goodsInfo.stock == 0" class="footer"> |
| 164 | - <div class="btn grey" @click="exchange"> | |
| 164 | + <div class="btn grey"> | |
| 165 | 165 | 补货中 |
| 166 | 166 | </div> |
| 167 | 167 | </div> |
| ... | ... | @@ -242,19 +242,9 @@ export default { |
| 242 | 242 | this.$parent.callApp(); |
| 243 | 243 | } |
| 244 | 244 | }, |
| 245 | - toLinkPointsMall () { | |
| 246 | - // 显示查看地址弹框 | |
| 247 | - let options = { | |
| 248 | - message: "兑换成功", | |
| 249 | - messageAlign: "center", | |
| 250 | - confirmButtonText: "我知道了", | |
| 251 | - confirmButtonCallback: "" | |
| 252 | - // confirmButtonCallback: this.addAddressCallback, | |
| 253 | - // params: { shopType: datas.shop_type, id: datas.id } | |
| 254 | - }; | |
| 255 | - this.$set(this.$parent, "showOptions", options); | |
| 256 | - // 显示通用浮层 | |
| 257 | - this.$parent.$refs.showModal.showLayer(); | |
| 245 | + toLinkPointsMall (addressId) { | |
| 246 | + // 实物商品兑换 | |
| 247 | + this.addLuckHealthOrder(addressId); | |
| 258 | 248 | // 调用back返回上一页 |
| 259 | 249 | // this.back(); |
| 260 | 250 | // this.$router.push({ |
| ... | ... | @@ -315,7 +305,7 @@ export default { |
| 315 | 305 | title: "", |
| 316 | 306 | message: "确定使用" + this.goodsInfo.num + "健康值兑换?", |
| 317 | 307 | confirmButtonText: "确定", |
| 318 | - confirmButtonCallback: this.addIntegralOrderconfirm, | |
| 308 | + confirmButtonCallback: this.addLuckHealthOrderconfirm, | |
| 319 | 309 | showCancelButton: true, |
| 320 | 310 | cancelButtonText: "取消" |
| 321 | 311 | }; |
| ... | ... | @@ -329,7 +319,7 @@ export default { |
| 329 | 319 | } |
| 330 | 320 | }, |
| 331 | 321 | // 确定兑换回调 |
| 332 | - addIntegralOrderconfirm () { | |
| 322 | + addLuckHealthOrderconfirm () { | |
| 333 | 323 | /** |
| 334 | 324 | * 判断shop_type是否等于1等于1为实物弹出填写地址,其他商品直接走兑换接口 |
| 335 | 325 | */ |
| ... | ... | @@ -340,7 +330,7 @@ export default { |
| 340 | 330 | // isExchange为false才可兑换防止连续点击 |
| 341 | 331 | if (!this.isExchange) { |
| 342 | 332 | // 兑换 |
| 343 | - this.addIntegralOrder(); | |
| 333 | + this.addLuckHealthOrder(); | |
| 344 | 334 | } |
| 345 | 335 | } |
| 346 | 336 | }, |
| ... | ... | @@ -356,15 +346,16 @@ export default { |
| 356 | 346 | /** |
| 357 | 347 | * 健康值兑换接口 |
| 358 | 348 | */ |
| 359 | - addIntegralOrder () { | |
| 349 | + addLuckHealthOrder (addressId) { | |
| 360 | 350 | // 加载中提示 |
| 361 | 351 | Indicator.open("加载中..."); |
| 362 | 352 | // 获取证书请求接口 |
| 363 | - this.http("/Api/" + this.getApiVersion().LuckDraw + "/addIntegralOrder", { | |
| 353 | + this.http("/Api/" + this.getApiVersion().LuckDraw + "/addLuckHealthOrder", { | |
| 364 | 354 | uid: this.getStore("uid"), |
| 365 | 355 | id: this.$route.query.goodsId, // 商品ID |
| 366 | - num: 1 | |
| 367 | - }, this.addIntegralOrderCallback, { | |
| 356 | + num: 1, // 数量 | |
| 357 | + addressId: addressId || "" // 实物商品ID | |
| 358 | + }, this.addLuckHealthOrderCallback, { | |
| 368 | 359 | method: "POST" |
| 369 | 360 | }); |
| 370 | 361 | }, |
| ... | ... | @@ -374,7 +365,7 @@ export default { |
| 374 | 365 | * @param {Object} res [服务器返回数据] |
| 375 | 366 | * @param {Object} ext [扩展参数] |
| 376 | 367 | */ |
| 377 | - addIntegralOrderCallback (res, ext) { | |
| 368 | + addLuckHealthOrderCallback (res, ext) { | |
| 378 | 369 | |
| 379 | 370 | // 加载完成 |
| 380 | 371 | Indicator.close(); |
| ... | ... | @@ -390,16 +381,9 @@ export default { |
| 390 | 381 | setTimeout(function () { |
| 391 | 382 | _this.isExchange = false; |
| 392 | 383 | }, 1500); |
| 393 | - // 提示语判断 | |
| 394 | - let tipMessage; | |
| 395 | - if (datas.shop_type == 2) { | |
| 396 | - tipMessage = "红包已存入您的账户,可前往“我的”—“我的卡券查看”" | |
| 397 | - } else if (datas.shop_type == 3) { | |
| 398 | - tipMessage = "付费音频已存入您的账户,可前往“我的”—“我的付费内容”—“已购内容收听”" | |
| 399 | - } | |
| 400 | 384 | // 显示查看地址弹框 |
| 401 | 385 | let options = { |
| 402 | - message: tipMessage, | |
| 386 | + message: "兑换成功", | |
| 403 | 387 | messageAlign: "center", |
| 404 | 388 | confirmButtonText: "我知道了", |
| 405 | 389 | confirmButtonCallback: "" |
| ... | ... | @@ -411,7 +395,6 @@ export default { |
| 411 | 395 | this.$parent.$refs.showModal.showLayer(); |
| 412 | 396 | } else if (res.code == 401) { |
| 413 | 397 | // 获取健康值商品详情页失败 |
| 414 | - // | |
| 415 | 398 | // 显示查看地址弹框 |
| 416 | 399 | let options = { |
| 417 | 400 | title: "", |
| ... | ... | @@ -433,7 +416,7 @@ export default { |
| 433 | 416 | addAddressCallback () { |
| 434 | 417 | this.pointsToast_control = true; |
| 435 | 418 | // 礼品兑换弹框派发 |
| 436 | - this.$refs.itemsInfo.getItemInfo(this.goodsInfo, params.id) | |
| 419 | + this.$refs.itemsInfo.getItemInfo(this.goodsInfo,this.$route.query.id) | |
| 437 | 420 | }, |
| 438 | 421 | /** |
| 439 | 422 | * 跳转赚取健康值页面 | ... | ... |