解决后端更新之后es中与前端不匹配bug,优化部分代码复用性
parent
275d76c0dd
commit
6ca01d2c71
|
@ -4,16 +4,16 @@
|
|||
<div class="goods-list">
|
||||
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
||||
<div class="goods-img">
|
||||
<u-image :src="item.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||
<u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-desc">
|
||||
<div class="goods-title">
|
||||
{{ item.goodsName }}
|
||||
{{ item.content.goodsName }}
|
||||
</div>
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">¥{{ item.price | unitPrice }}</div>
|
||||
<div class="goods-price">¥{{ item.content.price | unitPrice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -73,13 +73,12 @@ export default {
|
|||
delete submit[key];
|
||||
}
|
||||
});
|
||||
|
||||
let goodsList = await getGoodsList(submit);
|
||||
this.goodsList.push(...goodsList.data.result.content);
|
||||
},
|
||||
handleClick(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const name = "lilishop";
|
||||
const name = "lilishop"; //全局商城name
|
||||
const schemeName = 'lilishop' //唤醒app需要的schemeName
|
||||
export default {
|
||||
name: name,
|
||||
schemeLink: `${name}://`, //唤起app地址
|
||||
schemeLink: `${schemeName}://`, //唤起app地址
|
||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||
|
|
|
@ -85,16 +85,16 @@
|
|||
<div class="goodsClass">
|
||||
<u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow">
|
||||
<u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1">
|
||||
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.thumbnail">
|
||||
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</u-col>
|
||||
<u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2">
|
||||
<div class="title clamp3" style="">{{ item.goodsName }}</div>
|
||||
<div class="title clamp3" style="">{{ item.content.goodsName }}</div>
|
||||
<view class="price-box">
|
||||
<div class="price" v-if="item.price!=undefined">
|
||||
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
|
||||
formatPrice(item.price )[1]
|
||||
<div class="price" v-if="item.content.price!=undefined">
|
||||
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
||||
formatPrice(item.content.price )[1]
|
||||
}}
|
||||
</div>
|
||||
</view>
|
||||
|
@ -156,15 +156,15 @@
|
|||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item"
|
||||
@click="navigateToDetailPage(item)">
|
||||
<view class="image-wrapper">
|
||||
<image :src="item.thumbnail" mode="aspectFill"></image>
|
||||
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="goods-detail">
|
||||
<div class="title clamp">{{ item.goodsName }}</div>
|
||||
<div class="title clamp">{{ item.content.goodsName }}</div>
|
||||
<view class="price-box">
|
||||
<div class="price" v-if="item.price!=undefined">
|
||||
<div class="price" v-if="item.content.price!=undefined">
|
||||
|
||||
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
|
||||
formatPrice(item.price )[1]
|
||||
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
||||
formatPrice(item.content.price )[1]
|
||||
}}
|
||||
</div>
|
||||
</view>
|
||||
|
@ -538,7 +538,7 @@ export default {
|
|||
},
|
||||
navigateToDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
loadmore() {
|
||||
|
@ -669,7 +669,7 @@ export default {
|
|||
if (type == "refresh") {
|
||||
this.goodsList = [];
|
||||
}
|
||||
//没有更多直接返回
|
||||
//没有更多直接返回 #TODO
|
||||
let goodsList = await getGoodsList(this.params);
|
||||
|
||||
if (goodsList.data.result.content.length < 10) {
|
||||
|
|
|
@ -790,7 +790,7 @@ page {
|
|||
|
||||
.wrapper {
|
||||
height: auto;
|
||||
background: #ededed;
|
||||
background: #f7f7f7;
|
||||
padding-bottom: 200rpx;
|
||||
overflow: auto !important;
|
||||
}
|
||||
|
|
|
@ -48,10 +48,10 @@ span {
|
|||
border-radius: 100px;
|
||||
}
|
||||
.logo {
|
||||
margin-top: 20rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
text-align: center;
|
||||
transform: scale(2.5);
|
||||
}
|
||||
.logo-cell {
|
||||
text-align: center;
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<view class="login-ball bg-linear-gradient small"></view>
|
||||
|
||||
<view class="logo-cell">
|
||||
<image class="logo" src="/static/logo.png" mode="aspectFit"></image>
|
||||
<image class="logo" :src="config.logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="title">LiLi商城</view>
|
||||
<view class="title">{{config.name}}</view>
|
||||
|
||||
<!-- 验证码登录 -->
|
||||
<codeLogin @open="open" :status="value" v-if="login && loginData.code" />
|
||||
|
@ -31,8 +31,8 @@ import { getUserInfo } from "@/api/members";
|
|||
import storage from "@/utils/storage.js";
|
||||
import { loginCallback } from "@/api/connect.js";
|
||||
import { webConnect } from "@/api/connect.js";
|
||||
import config from "@/config/config";
|
||||
export default {
|
||||
|
||||
onShow() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.mpWechatLogin = false;
|
||||
|
@ -65,7 +65,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
lightColor:this.$lightColor,
|
||||
config,
|
||||
lightColor: this.$lightColor,
|
||||
mpWechatLogin: true, //是否加载微信登录
|
||||
value: true, //隐私政策
|
||||
loginData: {
|
||||
|
@ -102,7 +103,6 @@ export default {
|
|||
//联合信息返回登录
|
||||
stateLogin(state) {
|
||||
loginCallback(state).then((res) => {
|
||||
|
||||
let data = res.data;
|
||||
if (data.success) {
|
||||
storage.setAccessToken(data.result.accessToken);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<view class="wx-auth-container">
|
||||
<div class="box">
|
||||
<view class="logo-info">
|
||||
<text class="title">欢迎进入{{ projectName }}商城</text>
|
||||
<text class="title">欢迎进入{{ projectName }}</text>
|
||||
</view>
|
||||
<view class="small-tips">
|
||||
<view>为您提供优质服务,{{ projectName }}需要获取以下信息</view>
|
||||
|
@ -33,13 +33,14 @@ import { mpAutoLogin } from "@/api/connect.js";
|
|||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import storage from "@/utils/storage.js";
|
||||
import config from '@/config/config'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
||||
phoneAuthPopup: false,
|
||||
// 授权信息展示,商城名称
|
||||
projectName: "LiLi",
|
||||
projectName: config.name,
|
||||
//微信返回信息,用于揭秘信息,获取sessionkey
|
||||
code: "",
|
||||
//微信昵称
|
||||
|
|
|
@ -7,9 +7,11 @@
|
|||
<!-- 仅h5有效 打开App -->
|
||||
|
||||
<!-- 分享 -->
|
||||
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
||||
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId"
|
||||
:link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
||||
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
|
||||
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX" :y="navbarListY" placement="top-start" />
|
||||
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
|
||||
:y="navbarListY" placement="top-start" />
|
||||
<view class="index">
|
||||
|
||||
<!-- topBar -->
|
||||
|
@ -22,7 +24,8 @@
|
|||
</div>
|
||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||
<div class="headerRow">
|
||||
<div class="nav-item" v-for="header in headerList" :key="header.id" :class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
||||
<div class="nav-item" v-for="header in headerList" :key="header.id"
|
||||
:class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
||||
{{ header.text }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -30,7 +33,8 @@
|
|||
</div>
|
||||
</u-navbar>
|
||||
|
||||
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack" :is-back="false">
|
||||
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
|
||||
:is-back="false">
|
||||
<div>
|
||||
<div class="bg-back">
|
||||
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||
|
@ -42,7 +46,8 @@
|
|||
</view>
|
||||
|
||||
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
||||
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page" :scroll-top="tabScrollTop" @scroll="pageScroll">
|
||||
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
|
||||
:scroll-top="tabScrollTop" @scroll="pageScroll">
|
||||
<view>
|
||||
<!-- 轮播图 -->
|
||||
<GoodsSwiper id="main1" :res="imgList" />
|
||||
|
@ -58,7 +63,8 @@
|
|||
{{ goodsDetail.goodsName || "" }}
|
||||
</view>
|
||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
|
||||
</u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -88,7 +94,8 @@
|
|||
<view>分享</view>
|
||||
</view>
|
||||
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
|
||||
:name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -153,7 +160,8 @@
|
|||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||
|
||||
<!-- 宝贝详情 -->
|
||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" />
|
||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
|
||||
v-if="goodsDetail.id" />
|
||||
|
||||
<!-- 宝贝推荐 -->
|
||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||
|
@ -178,7 +186,8 @@
|
|||
</view>
|
||||
<!-- 正常结算页面 -->
|
||||
<view class="detail-btn" v-if="!isGroup">
|
||||
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">加入购物车</view>
|
||||
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">
|
||||
加入购物车</view>
|
||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||
</view>
|
||||
|
@ -215,10 +224,12 @@
|
|||
</view>
|
||||
|
||||
<!-- 配送地址弹窗 -->
|
||||
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id" :goodsId="goodsDetail.id" :addressFlag="addressFlag" />
|
||||
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
|
||||
:goodsId="goodsDetail.id" :addressFlag="addressFlag" />
|
||||
|
||||
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
||||
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy" @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
||||
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
|
||||
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
||||
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" />
|
||||
</view>
|
||||
</view>
|
||||
|
@ -510,11 +521,11 @@ export default {
|
|||
this.productId = id; // skuId
|
||||
// 这里请求获取到页面数据 解析数据
|
||||
|
||||
|
||||
let response = await getGoods(id, goodsId);
|
||||
if (!response.data.success) {
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack();
|
||||
return false;
|
||||
},500)
|
||||
}
|
||||
// 这里是绑定分销员
|
||||
if (distributionId || this.$store.state.distributionId) {
|
||||
|
@ -719,6 +730,7 @@ export default {
|
|||
|
||||
/**
|
||||
* 获取相似商品列表
|
||||
*
|
||||
*/
|
||||
getOtherLikeGoods() {
|
||||
getGoodsList({
|
||||
|
@ -728,7 +740,6 @@ export default {
|
|||
keyword: this.goodsDetail.name,
|
||||
}).then((res) => {
|
||||
this.likeGoodsList = res.data.result.content;
|
||||
console.warn(this.likeGoodsList);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
:fade="true"
|
||||
duration="450"
|
||||
:lazy-load="true"
|
||||
:src="item.thumbnail"
|
||||
:src="item.content.thumbnail"
|
||||
width="330rpx"
|
||||
height="330rpx"
|
||||
class="like-goods-uimage"
|
||||
|
@ -21,12 +21,12 @@
|
|||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<view style="background-color: #ffffff; width: 100%">
|
||||
<view class="name">{{ item.goodsName }}</view>
|
||||
<view class="name">{{ item.content.goodsName }}</view>
|
||||
<view class="price-sales">
|
||||
<div class="item-price" v-if="item.price != undefined">
|
||||
<div class="item-price" v-if="item.content.price != undefined">
|
||||
¥
|
||||
<span>{{ formatPrice(item.price)[0] }}</span>
|
||||
.{{formatPrice(item.price)[1]}}
|
||||
<span>{{ formatPrice(item.content.price)[0] }}</span>
|
||||
.{{formatPrice(item.content.price)[1]}}
|
||||
<!-- <text v-if="item.point != undefined">+{{ item.point }}积分</text> -->
|
||||
</div>
|
||||
</view>
|
||||
|
@ -44,7 +44,7 @@ export default {
|
|||
// 点击店铺推荐
|
||||
clickGoods(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`
|
||||
});
|
||||
},
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<!-- 数量 -->
|
||||
<view class="goods-skus-number">
|
||||
<view class="view-class-title">数量</view>
|
||||
<u-number-box :bg-color="numberBox.bgColor" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
||||
<u-number-box :bg-color="numberBox.bgColor" :max="200" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
||||
</u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -24,15 +24,15 @@
|
|||
<view class="store-recommend-title">商品推荐</view>
|
||||
<view class="recommend-list">
|
||||
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.thumbnail" height="218rpx">
|
||||
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
||||
</u-image>
|
||||
<view class="recommend-item-name">
|
||||
{{ item.goodsName }}
|
||||
{{ item.content.goodsName }}
|
||||
</view>
|
||||
<view class="item-price" v-if="item.price != undefined">
|
||||
¥<span class="item-price-blod">{{ formatPrice(item.price)[0] }}</span>.{{ formatPrice(item.price)[1] }}
|
||||
¥<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -58,7 +58,7 @@ export default {
|
|||
// 点击商品
|
||||
clickGoods(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="wrapper">
|
||||
<!-- 店铺信息模块 -->
|
||||
<div class="store flex">
|
||||
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || '/static/logo.png'" mode="aspectFit"></u-image>
|
||||
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || config.logo" mode="aspectFit"></u-image>
|
||||
<div class="box">
|
||||
<div class="store-name" @click="getStoreLicencePhoto">
|
||||
{{ storeInfo.storeName || ''}}
|
||||
|
@ -60,15 +60,15 @@
|
|||
<div class="contant" v-if="current == 0">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.thumbnail">
|
||||
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name">{{ item.goodsName }}</div>
|
||||
<div class="name">{{ item.content.goodsName }}</div>
|
||||
<div class="price">
|
||||
<div>¥{{ item.price | unitPrice }}</div>
|
||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
||||
</div>
|
||||
<view class="buyCount">
|
||||
<div>已售 {{ item.buyCount || "0" }}</div>
|
||||
<div>已售 {{ item.content.buyCount || "0" }}</div>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
@ -99,13 +99,14 @@ import {
|
|||
collectionGoods,
|
||||
getGoodsIsCollect,
|
||||
} from "@/api/members.js";
|
||||
|
||||
import config from '@/config/config'
|
||||
import storage from "@/utils/storage";
|
||||
import { getGoodsList } from "@/api/goods.js";
|
||||
import { getAllCoupons } from "@/api/promotions.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
config,
|
||||
scrollTop: 0,
|
||||
mainColor: this.$mainColor, //主色调
|
||||
current: 0, //初始tabs的索引
|
||||
|
@ -278,7 +279,7 @@ export default {
|
|||
*/
|
||||
navigateToGoodsDetail(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<div class="contant">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.thumbnail">
|
||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name">{{ item.goodsName }}</div>
|
||||
<div class="name">{{ item.content.goodsName }}</div>
|
||||
<div class="price">
|
||||
<div>¥{{ item.price | unitPrice }}</div>
|
||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
||||
</div>
|
||||
<view class="buyCount">
|
||||
<div>已售 {{ item.buyCount || "0" }}</div>
|
||||
|
@ -61,11 +61,12 @@ export default {
|
|||
*/
|
||||
navigateToGoodsDetail(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
async getGoodsData() {
|
||||
// #TODO
|
||||
let goodsList = await getGoodsList(this.params);
|
||||
if (goodsList.data.success) {
|
||||
this.goodsList.push(...goodsList.data.result.content);
|
||||
|
|
|
@ -124,6 +124,7 @@ import {
|
|||
helpBargain,
|
||||
} from "@/api/promotions";
|
||||
import shares from "@/components/m-share/index";
|
||||
import config from "@/config/config";
|
||||
export default {
|
||||
components: {
|
||||
shares,
|
||||
|
@ -178,7 +179,7 @@ export default {
|
|||
return {
|
||||
path: this.share(),
|
||||
title: `请快来帮我砍一刀${this.bargainDetail.goodsName}`,
|
||||
imageUrl: this.thumbnail || require("@/static/logo.png"),
|
||||
imageUrl: this.thumbnail || config.logo,
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
<view class="scroll-con">
|
||||
<view v-if="nomsg">没有相似商品</view>
|
||||
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
|
||||
<image :src="item.thumbnail" mode=""></image>
|
||||
<view class="nowrap">{{item.name}}</view>
|
||||
<image :src="item.content.thumbnail" mode=""></image>
|
||||
<view class="nowrap">{{item.content.name}}</view>
|
||||
<view>
|
||||
<text>¥{{item.price | unitPrice}}
|
||||
<text>¥{{item.content.price | unitPrice}}
|
||||
<!-- <text v-if="item.point">+{{item.point || 0}}积分</text> -->
|
||||
</text>
|
||||
<text>¥{{item.mktprice}}</text>
|
||||
<text>¥{{item.content.mktprice}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>已售{{item.buy_count}}件</text>
|
||||
<text>{{item.grade}}%好评</text>
|
||||
<text>已售{{item.content.buy_count}}件</text>
|
||||
<text>{{item.content.grade}}%好评</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -74,7 +74,7 @@
|
|||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/goods?id=' + item.id + "&goodsId=" +item.goodsId
|
||||
url: '/pages/product/goods?id=' + item.content.id + "&goodsId=" +item.content.goodsId
|
||||
})
|
||||
},
|
||||
loadData() {
|
||||
|
|
Loading…
Reference in New Issue