Commit 01de399b7ff9eda78980ef846ab7229d0d71782b

Authored by zhiyangdu
1 parent 5895d103

商品详情页

src/components/swiper/swiper.less
@@ -73,14 +73,15 @@ @@ -73,14 +73,15 @@
73 overflow: hidden; 73 overflow: hidden;
74 background: #F9F9F9; 74 background: #F9F9F9;
75 .swipe{ 75 .swipe{
76 - // width: 750px; 76 + width: 100vw;
  77 + margin: 0;
77 .swipe-item { 78 .swipe-item {
78 // width: 750px; 79 // width: 750px;
79 .item{ 80 .item{
80 /deep/ .img-box { 81 /deep/ .img-box {
81 .img { 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,7 +4,8 @@
4 <swipe-item class="swipe-item" v-for="(item, index) in swipers" :key="index"> 4 <swipe-item class="swipe-item" v-for="(item, index) in swipers" :key="index">
5 <div class="item" @click="$parent.$parent.gotoDetail(item)"> 5 <div class="item" @click="$parent.$parent.gotoDetail(item)">
6 <div class="img-box"> 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 </div> 9 </div>
9 </div> 10 </div>
10 </swipe-item> 11 </swipe-item>
src/pages/goodDetails/goodDetails.less
@@ -7,7 +7,14 @@ @@ -7,7 +7,14 @@
7 color: #333333; 7 color: #333333;
8 line-height: 48px; 8 line-height: 48px;
9 text-align: center; 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 .title-t{ 19 .title-t{
13 margin:20px 60px 10px 60px ; 20 margin:20px 60px 10px 60px ;
src/pages/goodDetails/goodDetails.vue
@@ -24,8 +24,8 @@ @@ -24,8 +24,8 @@
24 ($parent.isBack && isCNLive.value ? 62 : 10) + 24 ($parent.isBack && isCNLive.value ? 62 : 10) +
25 'px' 25 'px'
26 " 26 "
27 - v-if="banner"  
28 - :swipers="banner" 27 + v-if="goodsInfo && goodsInfo.simg"
  28 + :swipers="goodsInfo.simg"
29 :isPointsMall= 'true' 29 :isPointsMall= 'true'
30 :options="{ 30 :options="{
31 showIndicators: true 31 showIndicators: true
@@ -35,12 +35,12 @@ @@ -35,12 +35,12 @@
35 <!-- 内容 --> 35 <!-- 内容 -->
36 <div class="main-box"> 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 </div> 40 </div>
41 <!-- 积分 --> 41 <!-- 积分 -->
42 <div class="title-t"> 42 <div class="title-t">
43 - <span class="price">¥200</span> 43 + <span v-if="goodsInfo && goodsInfo.prices" class="price">¥{{goodsInfo.prices}}</span>
44 <span class="integral">15000</span> 44 <span class="integral">15000</span>
45 <span class="integral-in">积分</span> 45 <span class="integral-in">积分</span>
46 </div> 46 </div>
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 </div> 84 </div>
85 </div> 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 </div> 88 </div>
89 </template> 89 </template>
90 90
@@ -95,21 +95,12 @@ import swiper from &quot;@/components/swiper/swiper&quot;; @@ -95,21 +95,12 @@ import swiper from &quot;@/components/swiper/swiper&quot;;
95 import backBox from "@/components/backBox/backBox"; 95 import backBox from "@/components/backBox/backBox";
96 import columnListBox from "@/components/columnListBox/columnListBox"; 96 import columnListBox from "@/components/columnListBox/columnListBox";
97 import addressToast from "@/components/addressToast/addressToast"; 97 import addressToast from "@/components/addressToast/addressToast";
  98 +import { Toast, Indicator } from "mint-ui";
98 export default { 99 export default {
99 data () { 100 data () {
100 return { 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 backs: null, // 后退按钮组 104 backs: null, // 后退按钮组
114 similarGoods: null, // 相似商品 105 similarGoods: null, // 相似商品
115 pointsToast_control: this.$route.query.pointsToast_control, 106 pointsToast_control: this.$route.query.pointsToast_control,
@@ -172,7 +163,7 @@ export default { @@ -172,7 +163,7 @@ export default {
172 /** 163 /**
173 * 积分商品详情页页面接口 164 * 积分商品详情页页面接口
174 */ 165 */
175 - fansShopMessageList () { 166 + getGoodsInfo () {
176 167
177 // 校验登录 168 // 校验登录
178 if (this.$parent.checkLogin()) { 169 if (this.$parent.checkLogin()) {
@@ -181,9 +172,10 @@ export default { @@ -181,9 +172,10 @@ export default {
181 Indicator.open("加载中..."); 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 method: "POST" 179 method: "POST"
188 }); 180 });
189 } 181 }
@@ -194,7 +186,7 @@ export default { @@ -194,7 +186,7 @@ export default {
194 * @param {Object} res [服务器返回数据] 186 * @param {Object} res [服务器返回数据]
195 * @param {Object} ext [扩展参数] 187 * @param {Object} ext [扩展参数]
196 */ 188 */
197 - fansShopMessageListCallback (res, ext) { 189 + getGoodsInfoCallback (res, ext) {
198 190
199 // 加载完成 191 // 加载完成
200 Indicator.close(); 192 Indicator.close();
@@ -206,9 +198,7 @@ export default { @@ -206,9 +198,7 @@ export default {
206 let { data: datas } = res; 198 let { data: datas } = res;
207 199
208 /* 获取banner */ 200 /* 获取banner */
209 -  
210 -  
211 - 201 + this.goodsInfo = datas
212 /* 获取详细信息 */ 202 /* 获取详细信息 */
213 203
214 /* 相似商品 */ 204 /* 相似商品 */
@@ -228,7 +218,8 @@ export default { @@ -228,7 +218,8 @@ export default {
228 created () { 218 created () {
229 // 设置标题 219 // 设置标题
230 this.$set(this, "title", "积分商品详情页"); 220 this.$set(this, "title", "积分商品详情页");
231 - 221 + // 获取商品信息
  222 + this.getGoodsInfo();
232 // ios从url获取安卓localStorage 223 // ios从url获取安卓localStorage
233 if (this.isiPhone.value) { 224 if (this.isiPhone.value) {
234 this.pointsToast_control = this.$route.query.pointsToast_control; 225 this.pointsToast_control = this.$route.query.pointsToast_control;