Commit 8382bce0dc46b53be3d8dd090d1f05a7832d66be
1 parent
c2c360fb
积分兑换填写地址
Showing
4 changed files
with
131 additions
and
130 deletions
src/components/addressToast/addressToast.vue
src/pages/goodDetails/goodDetails.less
| 1 | 1 | .good-details-box{ |
| 2 | 2 | padding-bottom: 130px; |
| 3 | + .goods-img{ | |
| 4 | + display: block; | |
| 5 | + width: 100%; | |
| 6 | + height:750px | |
| 7 | + } | |
| 3 | 8 | .main-box{ |
| 4 | 9 | .title{ |
| 5 | 10 | font-size: 34px; |
| ... | ... | @@ -50,7 +55,6 @@ |
| 50 | 55 | .goods-info{ |
| 51 | 56 | margin: 30px; |
| 52 | 57 | width: 690px; |
| 53 | - height: 1653px; | |
| 54 | 58 | background: #FFFFFF; |
| 55 | 59 | box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.06); |
| 56 | 60 | border-radius: 24px; | ... | ... |
src/pages/goodDetails/goodDetails.vue
| ... | ... | @@ -18,20 +18,21 @@ |
| 18 | 18 | > |
| 19 | 19 | </back-box> |
| 20 | 20 | <!--轮播--> |
| 21 | - <swiper | |
| 21 | + <!-- <swiper | |
| 22 | 22 | :style=" |
| 23 | 23 | 'margin-top:' + |
| 24 | 24 | ($parent.isBack && isCNLive.value ? 62 : 10) + |
| 25 | 25 | 'px' |
| 26 | 26 | " |
| 27 | - v-if="goodsInfo && goodsInfo.simg" | |
| 27 | + v-if="simgList" | |
| 28 | 28 | :swipers="goodsInfo.simg" |
| 29 | 29 | :isPointsMall= 'true' |
| 30 | 30 | :options="{ |
| 31 | 31 | showIndicators: true |
| 32 | 32 | }" |
| 33 | 33 | > |
| 34 | - </swiper> | |
| 34 | + </swiper> --> | |
| 35 | + <img v-if="goodsInfo && goodsInfo.simg" class="goods-img" :src="goodsInfo.simg" alt=""/> | |
| 35 | 36 | <!-- 内容 --> |
| 36 | 37 | <div class="main-box"> |
| 37 | 38 | <!-- 标题 --> |
| ... | ... | @@ -41,7 +42,7 @@ |
| 41 | 42 | <!-- 积分 --> |
| 42 | 43 | <div class="title-t"> |
| 43 | 44 | <span v-if="goodsInfo && goodsInfo.prices" class="price">¥{{goodsInfo.prices}}</span> |
| 44 | - <span class="integral">15000</span> | |
| 45 | + <span v-if="goodsInfo && goodsInfo.num" class="integral">{{goodsInfo.num}}</span> | |
| 45 | 46 | <span class="integral-in">积分</span> |
| 46 | 47 | </div> |
| 47 | 48 | <!-- 商品信息 --> |
| ... | ... | @@ -49,23 +50,27 @@ |
| 49 | 50 | <div class="good-title"> |
| 50 | 51 | <span class="left"></span>商品详情<span class="right"></span> |
| 51 | 52 | </div> |
| 52 | - <div class="good-desc"> | |
| 53 | - 商品详情的文字内容的书写的的位置,商品详情的文字内容的书写的位置,商品详情的文字内容的书写的位置,商品详情的文字内容的书写的位置 | |
| 53 | + <div v-if="goodsInfo && goodsInfo.content" :v-html="goodsInfo.content" class="good-desc"> | |
| 54 | 54 | </div> |
| 55 | 55 | <div class="good-title"> |
| 56 | 56 | <span class="left"></span>兑换规则<span class="right"></span> |
| 57 | 57 | </div> |
| 58 | 58 | <div class="good-desc"> |
| 59 | - <div class="text-left">商品详情的文字内容的书写的的位置,商品详情的文字内容的书写的位置,商品详情的文字内容的书写的位置,商品详情的文字内容的书写的位置</div> | |
| 60 | - <div class="text-left"> | |
| 61 | - <span>· 正版授权</span> | |
| 62 | - 所售商品均已官方授权,请放心购买; | |
| 63 | - </div> | |
| 64 | - <div class="text-left"> | |
| 65 | - <span>· 正品保障</span> | |
| 66 | - 独家正品保障。 | |
| 59 | + <div v-if="goodsInfo && goodsInfo.shop_type && goodsInfo.shop_type == 1 || goodsInfo.shop_type == 2"> | |
| 60 | + <div class="text-left"> | |
| 61 | + 兑换此积分即可0元购买该商品;<br> | |
| 62 | + 仅限此商品使用,兑换后7天内有效; | |
| 63 | + </div> | |
| 64 | + <div class="text-left"> | |
| 65 | + <span>· 正版授权</span> | |
| 66 | + 所售商品均已官方授权,请放心购买; | |
| 67 | + </div> | |
| 68 | + <div class="text-left"> | |
| 69 | + <span>· 正品保障</span> | |
| 70 | + 独家正品保障。 | |
| 71 | + </div> | |
| 67 | 72 | </div> |
| 68 | - <div v-show="goodsInfo && goodsInfo.shop_type == 2" class="text-left"> | |
| 73 | + <div v-if="goodsInfo && goodsInfo.shop_type && goodsInfo.shop_type == 2" class="text-left"> | |
| 69 | 74 | 1、 您兑换的音频内容,音频上线期间可长期收听;<br> |
| 70 | 75 | 2、 兑换后暂不支持退款,感谢您的支持;<br> |
| 71 | 76 | 3、 兑换完成后若显示异常,请10分钟之后尝试;<br> |
| ... | ... | @@ -82,8 +87,8 @@ |
| 82 | 87 | </div> |
| 83 | 88 | <!-- 像是商品推荐 --> |
| 84 | 89 | <!-- 商品样式 7 列表 --> |
| 85 | - <column-list-box class="column-list-box" v-if="similarGoods && similarGoods.list && similarGoods.list.length" @jump="toDetail" | |
| 86 | - :lists="similarGoods" | |
| 90 | + <column-list-box class="column-list-box" v-if="goodsInfo && goodsInfo.list && goodsInfo.list.length" @jump="toDetail" | |
| 91 | + :lists="goodsInfo" | |
| 87 | 92 | com="7"> |
| 88 | 93 | </column-list-box> |
| 89 | 94 | </div> |
| ... | ... | @@ -113,8 +118,8 @@ export default { |
| 113 | 118 | banner: null, |
| 114 | 119 | goodsInfo: null, |
| 115 | 120 | backs: null, // 后退按钮组 |
| 116 | - similarGoods: null, // 相似商品 | |
| 117 | 121 | pointsToast_control: this.$route.query.pointsToast_control, |
| 122 | + isExchange: false, // 是否已经兑换 | |
| 118 | 123 | } |
| 119 | 124 | }, |
| 120 | 125 | //部件 |
| ... | ... | @@ -154,47 +159,109 @@ export default { |
| 154 | 159 | }) |
| 155 | 160 | }, |
| 156 | 161 | // 兑换 |
| 157 | - exchange (item) { | |
| 158 | - // 1月3号到1月31号才能领取 | |
| 159 | - // if (item.shop_type == 2) { | |
| 160 | - this.pointsToast_control = true; | |
| 161 | - // 礼品兑换弹框派发 | |
| 162 | - this.$refs.itemsInfo.getItemInfo(item) | |
| 163 | - // } else { | |
| 164 | - // // 显示查看地址弹框 | |
| 165 | - // let options = { | |
| 166 | - // title: "奖励已过领取时间", | |
| 167 | - // message: "领取时间: 2021-01-03至01-31", | |
| 168 | - // messageAlign: "center", | |
| 169 | - // confirmButtonText: "知道了" | |
| 170 | - // }; | |
| 171 | - // // 调用showModal层参数 | |
| 172 | - // this.$set(this.$parent, "showOptions", options); | |
| 173 | - // // 显示通用浮层 | |
| 174 | - // this.$parent.$refs.showModal.showLayer(); | |
| 175 | - | |
| 176 | - // } | |
| 162 | + exchange () { | |
| 163 | + // 提示用积分兑换兑换 | |
| 164 | + let options = { | |
| 165 | + title: "", | |
| 166 | + message: "确定使用" + this.goodsInfo.num + "积分兑换?", | |
| 167 | + confirmButtonText: "确定", | |
| 168 | + confirmButtonCallback: this.callAppModalCallback, | |
| 169 | + showCancelButton: true, | |
| 170 | + cancelButtonText: "取消" | |
| 171 | + }; | |
| 172 | + // 调用showModal层参数 | |
| 173 | + this.$set(this.$parent, "showOptions", options); | |
| 174 | + // 显示通用浮层 | |
| 175 | + this.$parent.$refs.showModal.showLayer(); | |
| 176 | + }, | |
| 177 | + // 确定兑换回调 | |
| 178 | + callAppModalCallback () { | |
| 179 | + // isExchange为false才可兑换防止连续点击 | |
| 180 | + if (!this.isExchange) { | |
| 181 | + // 兑换 | |
| 182 | + this.addIntegralOrder(); | |
| 183 | + } | |
| 177 | 184 | }, |
| 178 | 185 | /** |
| 179 | - * 积分商品详情页页面接口 | |
| 186 | + * 积分商品详情页页面接口 | |
| 187 | + */ | |
| 188 | + addIntegralOrder () { | |
| 189 | + // 加载中提示 | |
| 190 | + Indicator.open("加载中..."); | |
| 191 | + // 获取证书请求接口 | |
| 192 | + this.http("/Api/" + this.getApiVersion().LuckDraw + "/addIntegralOrder", { | |
| 193 | + uid: this.getStore("uid"), | |
| 194 | + id: this.$route.query.goodsId, // 商品ID | |
| 195 | + num: 1 | |
| 196 | + }, this.addIntegralOrderCallback, { | |
| 197 | + method: "POST" | |
| 198 | + }); | |
| 199 | + }, | |
| 200 | + | |
| 201 | + /** | |
| 202 | + * 积分商品详情页页面接口回调 | |
| 203 | + * @param {Object} res [服务器返回数据] | |
| 204 | + * @param {Object} ext [扩展参数] | |
| 180 | 205 | */ |
| 181 | - getGoodsInfo () { | |
| 206 | + addIntegralOrderCallback (res, ext) { | |
| 207 | + | |
| 208 | + // 加载完成 | |
| 209 | + Indicator.close(); | |
| 182 | 210 | |
| 183 | - // 校验登录 | |
| 184 | - if (this.$parent.checkLogin()) { | |
| 211 | + // 返回处理 | |
| 212 | + if (res.code == 200) { | |
| 213 | + // 解构数据 | |
| 214 | + let { data: datas } = res; | |
| 215 | + // 方式连续点击兑换 | |
| 216 | + this.isExchange = true; | |
| 217 | + // 两秒后可继续兑换 | |
| 218 | + let _this = this | |
| 219 | + setTimeout(function () { | |
| 220 | + this.isExchange = false; | |
| 221 | + }, 1500); | |
| 222 | + // 显示查看地址弹框 | |
| 223 | + let options = { | |
| 224 | + message: "兑换成功", | |
| 225 | + messageAlign: "center", | |
| 226 | + confirmButtonText: "我知道了", | |
| 227 | + // confirmButtonCallback: (datas.shop_type == 1) ? this.addAddressCallback(datas.shop_type) : "" | |
| 228 | + }; | |
| 229 | + this.$set(this.$parent, "showOptions", options); | |
| 230 | + // 显示通用浮层 | |
| 231 | + this.$parent.$refs.showModal.showLayer(); | |
| 232 | + } else if (res.code == 400) { | |
| 185 | 233 | |
| 186 | - // 加载中提示 | |
| 187 | - Indicator.open("加载中..."); | |
| 234 | + // 获取积分商品详情页失败 | |
| 235 | + Toast(res.message); | |
| 236 | + } else { | |
| 188 | 237 | |
| 189 | - // 获取证书请求接口 | |
| 190 | - this.http("/Api/" + this.getApiVersion().LuckDraw + "/integralGoodsInfo", { | |
| 191 | - uid: this.getStore("uid"), | |
| 192 | - id: this.$route.query.goodsId // 商品ID | |
| 193 | - }, this.getGoodsInfoCallback, { | |
| 194 | - method: "POST" | |
| 195 | - }); | |
| 238 | + // 获取积分商品详情页失败 | |
| 239 | + Toast("获取积分商品详情页失败"); | |
| 196 | 240 | } |
| 197 | 241 | }, |
| 242 | + // 填写地址 | |
| 243 | + addAddressCallback (shopType) { | |
| 244 | + debugger | |
| 245 | + // 如果是实物弹起填写地址弹窗 | |
| 246 | + if (shopType == 1) { | |
| 247 | + this.pointsToast_control = true; | |
| 248 | + // 礼品兑换弹框派发 | |
| 249 | + this.$refs.itemsInfo.getItemInfo(this.goodsInfo) | |
| 250 | + } | |
| 251 | + }, | |
| 252 | + /** | |
| 253 | + * 积分商品详情页页面接口 | |
| 254 | + */ | |
| 255 | + getGoodsInfo () { | |
| 256 | + // 加载中提示 | |
| 257 | + Indicator.open("加载中..."); | |
| 258 | + // 获取证书请求接口 | |
| 259 | + this.http("/Api/" + this.getApiVersion().LuckDraw + "/integralGoodsInfo", { | |
| 260 | + id: this.$route.query.goodsId // 商品ID | |
| 261 | + }, this.getGoodsInfoCallback, { | |
| 262 | + method: "POST" | |
| 263 | + }); | |
| 264 | + }, | |
| 198 | 265 | |
| 199 | 266 | /** |
| 200 | 267 | * 积分商品详情页页面接口回调 |
| ... | ... | @@ -211,13 +278,9 @@ export default { |
| 211 | 278 | |
| 212 | 279 | // 解构数据 |
| 213 | 280 | let { data: datas } = res; |
| 214 | - | |
| 215 | - /* 获取banner */ | |
| 216 | - this.goodsInfo = datas | |
| 217 | 281 | /* 获取详细信息 */ |
| 218 | - | |
| 282 | + this.goodsInfo = datas | |
| 219 | 283 | /* 相似商品 */ |
| 220 | - | |
| 221 | 284 | } else if (res.code == 400) { |
| 222 | 285 | |
| 223 | 286 | // 获取积分商品详情页失败 |
| ... | ... | @@ -266,77 +329,6 @@ export default { |
| 266 | 329 | |
| 267 | 330 | // 设置标题 |
| 268 | 331 | this.$set(this.backs, 'title', '积分商品详情页'); |
| 269 | - // 临时,实物商品列表 | |
| 270 | - this.$set(this, 'similarGoods', { | |
| 271 | - list: [ | |
| 272 | - { | |
| 273 | - activity: "0", | |
| 274 | - activity_desc: "", | |
| 275 | - addtime: "1604544867", | |
| 276 | - ads: "23123", | |
| 277 | - code: "160454486791776561000", | |
| 278 | - id: "9525539", | |
| 279 | - price: "0.01", | |
| 280 | - prices: "0.00", | |
| 281 | - shop_type: "1", | |
| 282 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png", | |
| 283 | - stock: "0", | |
| 284 | - stoptime: "0", | |
| 285 | - title: "aabbsdf350ml", | |
| 286 | - grade: 1500, // 积分 | |
| 287 | - time_state: 2, | |
| 288 | - stock: 0 | |
| 289 | - }, | |
| 290 | - { | |
| 291 | - activity: "0", | |
| 292 | - activity_desc: "", | |
| 293 | - addtime: "1604544867", | |
| 294 | - ads: "23123", | |
| 295 | - code: "160454486791776561000", | |
| 296 | - id: "9525539", | |
| 297 | - price: "0.01", | |
| 298 | - prices: "0.00", | |
| 299 | - shop_type: "1", | |
| 300 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png", | |
| 301 | - stock: "0", | |
| 302 | - stoptime: "0", | |
| 303 | - title: "aabbsdf350ml", | |
| 304 | - grade: 1500 // 积分 | |
| 305 | - }, | |
| 306 | - { | |
| 307 | - activity: "0", | |
| 308 | - activity_desc: "", | |
| 309 | - addtime: "1604544867", | |
| 310 | - ads: "23123", | |
| 311 | - code: "160454486791776561000", | |
| 312 | - id: "9525539", | |
| 313 | - price: "0.01", | |
| 314 | - prices: "0.00", | |
| 315 | - shop_type: "1", | |
| 316 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png", | |
| 317 | - stock: "0", | |
| 318 | - stoptime: "0", | |
| 319 | - title: "aabbsdf350ml", | |
| 320 | - grade: 1500 // 积分 | |
| 321 | - }, | |
| 322 | - { | |
| 323 | - activity: "0", | |
| 324 | - activity_desc: "", | |
| 325 | - addtime: "1604544867", | |
| 326 | - ads: "23123", | |
| 327 | - code: "160454486791776561000", | |
| 328 | - id: "9525539", | |
| 329 | - price: "0.01", | |
| 330 | - prices: "0.00", | |
| 331 | - shop_type: "1", | |
| 332 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png", | |
| 333 | - stock: "0", | |
| 334 | - stoptime: "0", | |
| 335 | - title: "aabbsdf350ml", | |
| 336 | - grade: 1500 // 积分 | |
| 337 | - } | |
| 338 | - ] | |
| 339 | - }); | |
| 340 | 332 | } |
| 341 | 333 | |
| 342 | 334 | }, | ... | ... |
src/pages/pointsMall/pointsMall.vue
| ... | ... | @@ -111,6 +111,8 @@ |
| 111 | 111 | |
| 112 | 112 | <script> |
| 113 | 113 | import { Toast, Indicator } from "mint-ui"; |
| 114 | +import callAppBox from "@/components/callAppBox/callAppBox"; | |
| 115 | +import backBox from "@/components/backBox/backBox"; | |
| 114 | 116 | import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; |
| 115 | 117 | import columnListBox from "@/components/columnListBox/columnListBox"; |
| 116 | 118 | export default { |
| ... | ... | @@ -128,6 +130,8 @@ export default { |
| 128 | 130 | }, |
| 129 | 131 | //部件 |
| 130 | 132 | components: { |
| 133 | + callAppBox, | |
| 134 | + backBox, | |
| 131 | 135 | goodsItem2, |
| 132 | 136 | columnListBox |
| 133 | 137 | }, |
| ... | ... | @@ -150,7 +154,7 @@ export default { |
| 150 | 154 | this.$router.push({ |
| 151 | 155 | path: '/pointsExchangeRecords', |
| 152 | 156 | query: { |
| 153 | - uid: this.$route.query.uid || 0, | |
| 157 | + uid: this.getStore("uid"), | |
| 154 | 158 | } |
| 155 | 159 | }) |
| 156 | 160 | }, |
| ... | ... | @@ -181,6 +185,7 @@ export default { |
| 181 | 185 | path: '/goodDetails', |
| 182 | 186 | query: { |
| 183 | 187 | goodsId: item.id, |
| 188 | + uid: this.getStore("uid") | |
| 184 | 189 | } |
| 185 | 190 | }) |
| 186 | 191 | }, | ... | ... |