Commit 003b650d8bcb32c05e5e24a63e7a04657685d9c2

Authored by zhiyangdu
1 parent 17549cb4

健康商城需要用到填写地址,积分加现金兑换不用到地址填写

src/components/appAddressToast/appAddressToast.vue
@@ -132,7 +132,8 @@ export default { @@ -132,7 +132,8 @@ export default {
132 confirm () { 132 confirm () {
133 // 最新地址信息回传给父组件 133 // 最新地址信息回传给父组件
134 // this.$parent.addressInfo = this.addressInfo; 134 // this.$parent.addressInfo = this.addressInfo;
135 - this.addLuckDrawAddress(); 135 + // this.addLuckDrawAddress();
  136 + this.$emit("toUpdate", this.addressInfo.id);
136 // 隐藏弹框 137 // 隐藏弹框
137 this.$parent.pointsToast_control = false; 138 this.$parent.pointsToast_control = false;
138 }, 139 },
@@ -150,42 +151,42 @@ export default { @@ -150,42 +151,42 @@ export default {
150 * *@param {string} id [商品id] 151 * *@param {string} id [商品id]
151 * *@param {string} id_card [身份证id] 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 * @param {object} res [服务器返回数据] 175 * @param {object} res [服务器返回数据]
175 * @param {object} ext [扩展参数] 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 </script> 192 </script>
src/pages/goodDetails/goodDetails.vue
@@ -180,7 +180,7 @@ import callAppBox from &quot;@/components/callAppBox/callAppBox&quot;; @@ -180,7 +180,7 @@ import callAppBox from &quot;@/components/callAppBox/callAppBox&quot;;
180 import swiper from "@/components/swiper/swiper"; 180 import swiper from "@/components/swiper/swiper";
181 import backBox from "@/components/backBox/backBox"; 181 import backBox from "@/components/backBox/backBox";
182 import columnListBox from "@/components/columnListBox/columnListBox"; 182 import columnListBox from "@/components/columnListBox/columnListBox";
183 -import appAddressToast from "@/components/appAddressToast/appAddressToast"; 183 +// import appAddressToast from "@/components/appAddressToast/appAddressToast";
184 import { Toast, Indicator } from "mint-ui"; 184 import { Toast, Indicator } from "mint-ui";
185 export default { 185 export default {
186 name: 'goodDetails', 186 name: 'goodDetails',
@@ -202,7 +202,7 @@ export default { @@ -202,7 +202,7 @@ export default {
202 swiper, 202 swiper,
203 backBox, 203 backBox,
204 columnListBox, 204 columnListBox,
205 - appAddressToast 205 + // appAddressToast
206 }, 206 },
207 //静态 207 //静态
208 props: [ 208 props: [
@@ -375,6 +375,7 @@ export default { @@ -375,6 +375,7 @@ export default {
375 if (this.goodsInfo.shop_type == 1) { 375 if (this.goodsInfo.shop_type == 1) {
376 // 实物弹出底部数量填写弹窗 376 // 实物弹出底部数量填写弹窗
377 this.opintsPopup(); 377 this.opintsPopup();
  378 + // 弹出填写地址
378 // this.addAddressCallback() 379 // this.addAddressCallback()
379 } else { 380 } else {
380 // isExchange为false才可兑换防止连续点击 381 // isExchange为false才可兑换防止连续点击
src/pages/healthGoodDetails/healthGoodDetails.vue
@@ -161,7 +161,7 @@ @@ -161,7 +161,7 @@
161 </div> 161 </div>
162 <!-- 有健康值商品售罄 --> 162 <!-- 有健康值商品售罄 -->
163 <div v-else-if="goodsInfo && goodsInfo.stock == 0" class="footer"> 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 </div> 166 </div>
167 </div> 167 </div>
@@ -242,19 +242,9 @@ export default { @@ -242,19 +242,9 @@ export default {
242 this.$parent.callApp(); 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 // 调用back返回上一页 248 // 调用back返回上一页
259 // this.back(); 249 // this.back();
260 // this.$router.push({ 250 // this.$router.push({
@@ -315,7 +305,7 @@ export default { @@ -315,7 +305,7 @@ export default {
315 title: "", 305 title: "",
316 message: "确定使用" + this.goodsInfo.num + "健康值兑换?", 306 message: "确定使用" + this.goodsInfo.num + "健康值兑换?",
317 confirmButtonText: "确定", 307 confirmButtonText: "确定",
318 - confirmButtonCallback: this.addIntegralOrderconfirm, 308 + confirmButtonCallback: this.addLuckHealthOrderconfirm,
319 showCancelButton: true, 309 showCancelButton: true,
320 cancelButtonText: "取消" 310 cancelButtonText: "取消"
321 }; 311 };
@@ -329,7 +319,7 @@ export default { @@ -329,7 +319,7 @@ export default {
329 } 319 }
330 }, 320 },
331 // 确定兑换回调 321 // 确定兑换回调
332 - addIntegralOrderconfirm () { 322 + addLuckHealthOrderconfirm () {
333 /** 323 /**
334 * 判断shop_type是否等于1等于1为实物弹出填写地址,其他商品直接走兑换接口 324 * 判断shop_type是否等于1等于1为实物弹出填写地址,其他商品直接走兑换接口
335 */ 325 */
@@ -340,7 +330,7 @@ export default { @@ -340,7 +330,7 @@ export default {
340 // isExchange为false才可兑换防止连续点击 330 // isExchange为false才可兑换防止连续点击
341 if (!this.isExchange) { 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,15 +346,16 @@ export default {
356 /** 346 /**
357 * 健康值兑换接口 347 * 健康值兑换接口
358 */ 348 */
359 - addIntegralOrder () { 349 + addLuckHealthOrder (addressId) {
360 // 加载中提示 350 // 加载中提示
361 Indicator.open("加载中..."); 351 Indicator.open("加载中...");
362 // 获取证书请求接口 352 // 获取证书请求接口
363 - this.http("/Api/" + this.getApiVersion().LuckDraw + "/addIntegralOrder", { 353 + this.http("/Api/" + this.getApiVersion().LuckDraw + "/addLuckHealthOrder", {
364 uid: this.getStore("uid"), 354 uid: this.getStore("uid"),
365 id: this.$route.query.goodsId, // 商品ID 355 id: this.$route.query.goodsId, // 商品ID
366 - num: 1  
367 - }, this.addIntegralOrderCallback, { 356 + num: 1, // 数量
  357 + addressId: addressId || "" // 实物商品ID
  358 + }, this.addLuckHealthOrderCallback, {
368 method: "POST" 359 method: "POST"
369 }); 360 });
370 }, 361 },
@@ -374,7 +365,7 @@ export default { @@ -374,7 +365,7 @@ export default {
374 * @param {Object} res [服务器返回数据] 365 * @param {Object} res [服务器返回数据]
375 * @param {Object} ext [扩展参数] 366 * @param {Object} ext [扩展参数]
376 */ 367 */
377 - addIntegralOrderCallback (res, ext) { 368 + addLuckHealthOrderCallback (res, ext) {
378 369
379 // 加载完成 370 // 加载完成
380 Indicator.close(); 371 Indicator.close();
@@ -390,16 +381,9 @@ export default { @@ -390,16 +381,9 @@ export default {
390 setTimeout(function () { 381 setTimeout(function () {
391 _this.isExchange = false; 382 _this.isExchange = false;
392 }, 1500); 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 let options = { 385 let options = {
402 - message: tipMessage, 386 + message: "兑换成功",
403 messageAlign: "center", 387 messageAlign: "center",
404 confirmButtonText: "我知道了", 388 confirmButtonText: "我知道了",
405 confirmButtonCallback: "" 389 confirmButtonCallback: ""
@@ -411,7 +395,6 @@ export default { @@ -411,7 +395,6 @@ export default {
411 this.$parent.$refs.showModal.showLayer(); 395 this.$parent.$refs.showModal.showLayer();
412 } else if (res.code == 401) { 396 } else if (res.code == 401) {
413 // 获取健康值商品详情页失败 397 // 获取健康值商品详情页失败
414 - //  
415 // 显示查看地址弹框 398 // 显示查看地址弹框
416 let options = { 399 let options = {
417 title: "", 400 title: "",
@@ -433,7 +416,7 @@ export default { @@ -433,7 +416,7 @@ export default {
433 addAddressCallback () { 416 addAddressCallback () {
434 this.pointsToast_control = true; 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 * 跳转赚取健康值页面