Commit 01de399b7ff9eda78980ef846ab7229d0d71782b

Authored by zhiyangdu
1 parent 5895d103

商品详情页

src/components/swiper/swiper.less
... ... @@ -73,14 +73,15 @@
73 73 overflow: hidden;
74 74 background: #F9F9F9;
75 75 .swipe{
76   - // width: 750px;
  76 + width: 100vw;
  77 + margin: 0;
77 78 .swipe-item {
78 79 // width: 750px;
79 80 .item{
80 81 /deep/ .img-box {
81 82 .img {
82   - width: 565px;
83   - height: 446px;
  83 + // width: 565px;
  84 + // height: 446px;
84 85 }
85 86 }
86 87 }
... ...
src/components/swiper/swiper.vue
... ... @@ -4,7 +4,8 @@
4 4 <swipe-item class="swipe-item" v-for="(item, index) in swipers" :key="index">
5 5 <div class="item" @click="$parent.$parent.gotoDetail(item)">
6 6 <div class="img-box">
7   - <img v-lazy="item.simg + SIGN.BIG" class="img" mode="widthFix" />
  7 + <img v-if="isPointsMall" v-lazy="item + SIGN.BIG" class="img" mode="widthFix" />
  8 + <img v-else v-lazy="item.simg + SIGN.BIG" class="img" mode="widthFix" />
8 9 </div>
9 10 </div>
10 11 </swipe-item>
... ...
src/pages/goodDetails/goodDetails.less
... ... @@ -7,7 +7,14 @@
7 7 color: #333333;
8 8 line-height: 48px;
9 9 text-align: center;
10   - margin-top: 30px;
  10 + margin:30px 20px 0 20px;
  11 + display: -webkit-box;
  12 + -webkit-line-clamp: 2;
  13 + /*! autoprefixer: off */
  14 + -webkit-box-orient: vertical;
  15 + /*! autoprefixer: on */
  16 + text-overflow: ellipsis;
  17 + overflow: hidden;
11 18 }
12 19 .title-t{
13 20 margin:20px 60px 10px 60px ;
... ...
src/pages/goodDetails/goodDetails.vue
... ... @@ -24,8 +24,8 @@
24 24 ($parent.isBack && isCNLive.value ? 62 : 10) +
25 25 'px'
26 26 "
27   - v-if="banner"
28   - :swipers="banner"
  27 + v-if="goodsInfo && goodsInfo.simg"
  28 + :swipers="goodsInfo.simg"
29 29 :isPointsMall= 'true'
30 30 :options="{
31 31 showIndicators: true
... ... @@ -35,12 +35,12 @@
35 35 <!-- 内容 -->
36 36 <div class="main-box">
37 37 <!-- 标题 -->
38   - <div class="title">
39   - 山东沂蒙 优质大蒜山东沂蒙 优质大蒜
  38 + <div v-if="goodsInfo && goodsInfo.title" class="title">
  39 + {{goodsInfo.title}}
40 40 </div>
41 41 <!-- 积分 -->
42 42 <div class="title-t">
43   - <span class="price">¥200</span>
  43 + <span v-if="goodsInfo && goodsInfo.prices" class="price">¥{{goodsInfo.prices}}</span>
44 44 <span class="integral">15000</span>
45 45 <span class="integral-in">积分</span>
46 46 </div>
... ... @@ -84,7 +84,7 @@
84 84 </div>
85 85 </div>
86 86 <!-- 地址信息组件 -->
87   - <address-toast ref="itemsInfo" @toUpdate="fansShopMessageList" v-show="pointsToast_control"></address-toast>
  87 + <address-toast ref="itemsInfo" @toUpdate="getGoodsInfo" v-show="pointsToast_control"></address-toast>
88 88 </div>
89 89 </template>
90 90  
... ... @@ -95,21 +95,12 @@ import swiper from &quot;@/components/swiper/swiper&quot;;
95 95 import backBox from "@/components/backBox/backBox";
96 96 import columnListBox from "@/components/columnListBox/columnListBox";
97 97 import addressToast from "@/components/addressToast/addressToast";
  98 +import { Toast, Indicator } from "mint-ui";
98 99 export default {
99 100 data () {
100 101 return {
101   - banner: [
102   - { id: "290",
103   - shop_type: "",
104   - simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15d4780610.jpg",
105   - title: "世行",
106   - to: "0",
107   - type: "0", }, { id: "290",
108   - shop_type: "",
109   - simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15d4780610.jpg",
110   - title: "世行",
111   - to: "0",
112   - type: "0", }],
  102 + banner: null,
  103 + goodsInfo: null,
113 104 backs: null, // 后退按钮组
114 105 similarGoods: null, // 相似商品
115 106 pointsToast_control: this.$route.query.pointsToast_control,
... ... @@ -172,7 +163,7 @@ export default {
172 163 /**
173 164 * 积分商品详情页页面接口
174 165 */
175   - fansShopMessageList () {
  166 + getGoodsInfo () {
176 167  
177 168 // 校验登录
178 169 if (this.$parent.checkLogin()) {
... ... @@ -181,9 +172,10 @@ export default {
181 172 Indicator.open("加载中...");
182 173  
183 174 // 获取证书请求接口
184   - this.http("/Api/" + this.getApiVersion().dynamic + "/fansShopMessageList", {
185   - uid: this.getStore("uid")
186   - }, this.fansShopMessageListCallback, {
  175 + this.http("/Api/" + this.getApiVersion().index + "/goods_info", {
  176 + uid: this.getStore("uid"),
  177 + id: this.$route.query.goodsId // 商品ID
  178 + }, this.getGoodsInfoCallback, {
187 179 method: "POST"
188 180 });
189 181 }
... ... @@ -194,7 +186,7 @@ export default {
194 186 * @param {Object} res [服务器返回数据]
195 187 * @param {Object} ext [扩展参数]
196 188 */
197   - fansShopMessageListCallback (res, ext) {
  189 + getGoodsInfoCallback (res, ext) {
198 190  
199 191 // 加载完成
200 192 Indicator.close();
... ... @@ -206,9 +198,7 @@ export default {
206 198 let { data: datas } = res;
207 199  
208 200 /* 获取banner */
209   -
210   -
211   -
  201 + this.goodsInfo = datas
212 202 /* 获取详细信息 */
213 203  
214 204 /* 相似商品 */
... ... @@ -228,7 +218,8 @@ export default {
228 218 created () {
229 219 // 设置标题
230 220 this.$set(this, "title", "积分商品详情页");
231   -
  221 + // 获取商品信息
  222 + this.getGoodsInfo();
232 223 // ios从url获取安卓localStorage
233 224 if (this.isiPhone.value) {
234 225 this.pointsToast_control = this.$route.query.pointsToast_control;
... ...